I don't know why it would mirror yours, unless you mirrored the line before you ran your command. It shouldn't do anything to the line on your routine. On my version of it however, the deletion of the line is supposed to happen. I don't know where the point is coming from, unless you have blip-mode on. Sooo, what I'm trying to show you is this: Your code has a command line in it and mine does not. Therefore, Autocad does not recognize mine as a command and when you undo mine, it undoes that routine and the command before it. So, you saw nothing happen to the line the first time you ran my version. I believe that's because you saved the drawing after drawing the line OR before calling the routine. Just like making sure OSMODE is set to 0 before running the routine, we can make sure autocad views this as a command. We have a couple of options here. At the beginning of the routine we can add this (command ".undo" "be") and at the end add (command ".undo" "e") or if we want to leave the transparent functionality of my version, we could give you your first taste of ActiveX.
Before we do, another test. Without the command lines in place draw a line. This time pick the first point, but not the second. At this time invoke my version transparently (with an apostrophe in front of it), then when you've finished moving the text to the dimension, while cad is still waiting for the next point, try invoking your version transparently. What you should be understanding here is that if ever you desire a command to be able to be used transparently, you cannot have command in the code. ActiveX will give us the ability to set the undo flags without using command. Why would we want this to be able to be transparent? No reason, just thought I'd show that it's possible and try to explain how, just in case you ever have code where you'd want that functionality. Be back shortly with more info.