CAB, I think the best bet is to switch to WCS while running the routine and switch it back when you're done (preferably in an *error* function).
There are alot of transformations to consider in your code. To name a few: 1. Circles 2. Inserts 3. Intersection points.
Not only do you have to displace points, but also planes.
I would simply call (command "UCS" "World") at the start and (command "UCS" "Previous") at the end. Unless, of course, your gridlines are non-planar to WCS.