To turn on this feature, select JSL code folding in the Script Editor preferences. Then you can expand and collapse blocks of code by right-clicking on a script and selecting Advanced > Expand All or Collapse All.