Thanks Tim for checking it.
It appears that when the command is first used on a line something inside AL goes a bit wonky, a way I found after struggling for ages - as I thought the custom script I was using in the real drawing (not the one posted) was wrong, is to force TC to execute another command first.
I wrote down the x, y coordinates of the default line reference point and put them in MoveAbs command, making sure it was the first command, this means the line won't actually move but forces TC to do something else before the movement which seems to correct things.
0 0 MoveAbs x(ref point) y(ref point) 0
Ah well, it seems the latest AL / 2015 cured the undo but broke something else