Same way you sort a list.
I imagine that they had some indexing system like we have.
For example, if you had a line of tanks along the x axis, and you wanted to insert one in the middle, you could either set the x values less than the desired position to x-n, or x+n for the places greater than, then move the one you want. Of course that gets complicated if you want to keep it from running over other units. It would have to be able to find a path using the other tanks as obstacles. That's even more complicated if you try to do that while they are all moving. So you would need events to find a path if an obstacle moves, constantly.
Trigs your friend here, so are square roots if you like square formations.