Danke, das wäre wirklich zuviel Aufwand.
Eine andere Möglichkeit habe ich noch im englischen Forum gefunden (allerdings ohne Zustandsspeicherung, also entweder eingeklappt oder ausgeklappt starten):
For the opening of scripts to be folded by default, then add this into your User Options file and save.