The first thing to check is the values of your globals, properties, and run-handler variables at the moment the script finishes. They’re saved with the script and if they’re massive texts or lists, you’ll get such an error. Try setting them to something brief like “” just before the end of the script or, better still, use local variables.