According to olivier hericord:
i found something quite annoying and possibly dangerous.....when editing a script its very usual to delete a block just to see what happens....but hitting the Apple-S seems to kill the undo list sometime...
The very basic test I just did showed that Undo is preserved across Saves 'as it should).