This project simulates the requirements of a cloud-based leaderboard that must account for the chance that multiple copies of a project may be trying to update the cloud vars simultaneously. It runs a loop of 8 "rapid-fire" writes. I've been running 2 copies (1 on each of my 2 accounts) to simulate "collisions". So far the results are encouraging.
I've also accounted for the user clicking the stop flag in the middle of writing out the set of vars. I intercept the stop, and continue the write (only if it was previously in progress) to make sure the list does not get corrupted and to make sure the "lock" var gets reset. This requires that the write vars routine be re-enterable. You may test this yourself by clicking the stop flag in the middle of the cloud vars changing.