The UI in Mach is only updated periodically - roughly 10X/second. When you "write" a DRO, the DRO itself does not get updated immediately. Instead, the request to write the DRO goes into a queue of things to do on the next UI update. So, if you write a DRO, then immediately read it back, you stand a good chance of reading the old value, rather than the new one. Putting a Sleep(200) between the write and read should also guarantee a UI update has occurred.
All of this will me MUCH simpler and more deterministic in v4, and scripts will very rarely need to include explicit delays to get the expected behavior.
Regards,
Ray L.