Invalid method code length

I’m just coding a Gateway Timer Script. After a big bunch of code, I’m getting the error you can see in the following screenshot when I try to apply new changes

Does this mean I have reached the maximum number of lines per one script? Shall I break the script in two or more scripts, each running at a 2000 ms rate?

Thank you in advance,

If I recall correctly, event scripts are limited to 4k characters. Consider putting the bulk of your code in a function in a project script module and calling that from your event script.

Right, split your code into one or more methods.