Mel + Script Editor Crash on Save if open

Hello all! (First post :): ) - I created my first script in Mel, (I’ve used other scripting languages in the past) and it is functioning as it should with one hiccup that I believe may be due to system memory. If I run the script, then attempt to save afterwards (With the Script Editor Window open + the script running, or just the script editor open) I receive an immediate crash. Happens on both my laptop and PC. The workaround is to make my changes using the GUI control I built, close down the script and the script editor, rotate my view or something, and then it will save without crashing. Is this being caused because I did not clear up some memory after using it in the script or something external like a QT plugin? I would like to modify and iterate on this script but won’t until I figure out what I’m doing wrong.
–Thanx in advance any responders!

(Saved as a .txt file for the forum)