It’s an editor limitation, yes. However, “Script” first composes the lines and then uses eval from scratch each time internally, so I don’t recommend using that with large functions in the first place (at least not when it runs frequently).
The easiest option is to make a small plugin like so:
function myScript() {
// You can name this anything in place of `myScript`.
// Ideally, use at least somewhat descriptive names.
// Also, just add multiple functions if you need more.
// Your Script goes here.
}
And then call it inside the “Script” Command like this: myScript.call(this)
.call(this) instead of passing the interpreter as argument means you can use this inside myScript as you would in the “Script” Command.