Internal order of execution effects my script?

I have a network replicator. In a recent unrelated-to-the-network update the script broke and had all the other characters walking in place at spawn. There was no error.The fix was deleting the script, and then hitting undo. Nothing on the surface has changed. But there must be an internal order of compile that this rearranged because now it works.
The fact that my script could fall prey to this means it wasn’t well planned, it wasn’t at all actually, but I don’t have the time to redraw it now and just wish to know more if any about what’s going on inside the black box of the Roblox engine and how that’s being decided for me.