so what you need to do is
when anything is edited,
see if there are any items in the data variable that are xml
extension syn_scripts (item (whatever) of data).
DO NOT use the scisnap block. very buggy and does not support deleting.
Actually, in my experience, the extension syn_scripts has the exact same problems and replaces any existing scripts in the sprite, unlike the scisnap block which simply adds blocks/scripts.
im trying to whenever i rename all variables either update every script so that i can send the change through mqtt or get the xml and send it like that
Edit: AND, finally the block is actually working for me! Note that, with either the Scisnap block or the syn_scripts block, when it is broken, it can still load primitives, just not custom blocks (replaces them with "undefined!").
My best advice would be to begin by removing ALL the scripts in the sprite:
And then one by one adding the scripts you want using the SciSnap! install eventhandler block. Just iterate through a saved copy of "my [scripts V]"; excluding the one you want to add to, and then do something like this: