This is for anyone who has ever lost a lot of work on a script due to the script editor not saving and Maya crashing. This script will work in the background to save the script editor contents whenever the scene saves, either manually or from autosave.
It can also diable the "AutoSave skipped - scene not modified" skip if required, as I personally don't want to have my scripts not regularly save just because I haven't touched the scene.
Automatically binds itself to when the scene autosaves or is manually saved. Just copy the files over according to the instructions.
If you get annoyed at it printing things, type AutoSave().silent(True) in the Python command bar, and it'll never bother you again. I've just left it on to make sure it is working for everyone, because if it's always coming up with errors, let me know and I can try fix it.
How to restore backup files:
It saves backup files which Maya will normally delete, but in the event of a crash where they won't be deleted, if the script finds them when it starts, it will move them into a folder, so that they may be restored if anything ends up corrupted.
Currently you'll need to manually restore them (from C:\Users\(name)\Documents\maya\(version)\prefs\scriptEditorTemp\(backup)\), but in the future I may try make it automatic.
Save different backup versions
Auto restore backups