I would place the script lines in an array of strings. Then, I would use a listbox to display a moving window of the array elements. For example, you start showing script lines at index 0 to index 24. With a pageDown, you fetch elements 25 to 49, and so on. You can then develop logic to edit specific elements, move up and down by larger or smaller increments, even run individual elements or groups of elements. The key is that the data is kept in the array, and the UI only serves to show and manipulate the data.
Arrays can have a maximum index value of 2,147,483,646 therefore with this concept, you are probably constrained by the system resources only.