Hey everyone, computer died, at the university right now xD
Just at the top of my head, depending on the amount of units you have, you could have a location with a lot of a unit that can burrow. Let's use the Zergling. Have the computer that owns the unit allied to the players. Create 3 locations: Burrowed, Unit, Cleanup. Have 1 over the burrowed units, 2 very small ones, perhaps 1x1 pixel for Unit and Cleanup. At a certain interval, say, 1000ms (via death counter), have the triggers:
... I'll just write down the concept -_-
Have one location constantly checking to see if a unit has a zergling underneath. If it doesn't, the trig will move one from the Burrowed location. If the unit already has a zergling underneath, then the unit hasn't moved. You'll have to set up how often each unit will be checked. After deciding what happens if the unit is considered moving or not, you'll have to make sure the burrowed units that you don't use anymore on the field are removed before checking again.
Immediate problem I recognize with this is that if you have, say, 12 units in a formation of 3x4 with all the units moving up, like so:
xxxx
oooo
xxxx
Problem here is that when they're all moving upwards, the O units will run into the X units' burrowed zerglings, therefore detected as not moving and teleported.
I'm sure there are a bunch of problems with this, but if anyone sees anything worthwhile in this though, feel free to expand it
EDIT
Also, wouldn't
Always
move all men from x to y
move all hydra from y to x
make the hydra be in a constant teleportation of x and y?
None.