Thank you. I guess I will have to do that.
Before starting coding in Viz, I did lots of coding in Cinema 4D and it was quite easy to store whatever I wanted in the Undo pool, so that the user could easily revert to the pre-script-execution state.
I have tried to use the System.SendCommand to evoke the "START_UNDOABLE_OPERATION" but I got an error, so I assume it is not the way to use it.
In a nutshell, I could not use any of the commands.
It would be great to have a way to store the current state of the document before doing any changes using code, so that the user could revert to the previous state, after running a script.