Added 7 minutes later
Hmm... I don't know why they made it so complicated...
I was helped by a single script function, MakeTownMovable(townName), which makes the town movable (it sets the IsRemovable property to true).
In general, that piece of script looks like this:
MakeTownMovable(townName);
SetObjectPosition(townName, newX, newY, newFloor);
SetObjectOwner(townName, 1);