You would have to keep track of the orders of the unit.
I think hashtables would be a good solution. Then store a variable with the region the unit was ordered to move at and check if a unit stops moving ( I think there is a system in the spell section for this), then load the stored variable and order the unit to go there.
If you have a few unit I would recommend using indexed variables instead.