That's ok if you think it should be done that way, but the users are not programmers, they most of time spend
his/her time to construct something and not thinking if "this or that" is a variable or a completed task.
But the undo command is used in other apps too as the name say "un-do" or "change something back in a earlier stage".
The mentioned cube or whatever had a length of 30mm and now it has a length of 40mm.
I think a task was also created, now the new cube length is longer then in the stage before.
So, from this point of view, this has nothing to do with variables.
Of course the length and all other operations are related to variables, but that is on a programming level i think so.
I'm a programmer too and now how things goes under programming, but we have to think as the user, as a simple user who makes a
very complex creation as we make too when we write our lines of code and we must not at all mix up these two worlds.
I think the undo command should undo any changes what was made in the past and should nothing have with functions or variables etc..
How deep, I mean how far can an undo command go back? that comes also in rolling but maybe 5-10 changes backward would be nice...
No matter what live you have, but how you use it...