We all get to a point where we can't find outselves in our scripts. I was recently tought that we can use what is called a "#region [region name]" to define a certain part of our code, to end it with "#endregion", and then we could collapse all the section from our eyes using the plus icon next to it.
The issue is that the editor doesn't save these collapes items, and the moment you close the script tab and then re-open it, eveything is expanded again.
This is the same way if trying to collapse functions and other blocks of code that have the plus sign next to them.
There's a open ticket for this:
https://github.com/adventuregamestudio/ags/issues/2384