Is this happening even if you've repaired installation?
As a matter of fact is happening on my end too.
I started noticing this behavior since two updates ago. Now I have to keep saving my documents constantly in fear that I keep randomly loosing scripts as I work between fields.
I also got in the habit of copying and pasting my scripts to notepad. Is happening a lot with my Acrobat.
Good to know I'm not the only1, I also use notepad for that 🙂