Resolving an ongoing issue (scripts are moving around)

see: scripts are moving around for the original issue.
in the above topic, I was having a problem where new sprites would be created when loading a project, and they would "steal" the scripts from other sprites. however, I recently fixed the issue.
while looking through this project's XML, I found this section:

xml

<variable name="my folder tree"> <context id="28031"> <inputs/> <variables/> <block var="me"/> <receiver> <sprite name="BROKEN^&%%&" idx="7" x="-141" y="136.00000000000009" heading="90" scale="0.5" volume="100" pan="0" rotation="0" instrument="2" draggable="true" hidden="true" costume="0" color="253,255,246,1" pen="tip" id="28034"> <costumes> <list struct="atomic" id="28035"/> </costumes> <sounds> <list struct="atomic" id="28036"/> </sounds> <blocks/>

after making every sprite-local variable in the project that stored a script transient, the issue was fixed. extra sprites stopped appearing.

So, I think the problem has something to do with the way Snap! saves and loads script contexts. I could be wrong, since I don't know much about the inner workings of Snap!, but hopefully this issue can be resolved.

@bh do you know what's going on here?