This approach is too simplistic to be useful in nearly any environment. On top of that, its basically the exact opposite of what undo is/has always been.
The "correct" way to do undo, is to perform an event, and keep a list of inverse events. As you pop those off the undo stack, you can simply execute them.
As you mentioned, this may be slightly more complicated in a multi-user environment -- but in this example, it would absolutely be the right way to go. Plus, this is so easy to get working in javascript, where you can actually push functions to the stack, and then execute them when you pop them off...
The "correct" way to do undo, is to perform an event, and keep a list of inverse events. As you pop those off the undo stack, you can simply execute them.
As you mentioned, this may be slightly more complicated in a multi-user environment -- but in this example, it would absolutely be the right way to go. Plus, this is so easy to get working in javascript, where you can actually push functions to the stack, and then execute them when you pop them off...