best way programatically is to add an undo section to each procedure and then call the procedures in reverse order with the undo switch on.
but this will only go so far, you may have to store variable values aswell
eg
Sub dosomestuff(number1 as integer,number2 as integer, undo as boolean)...