It's already there.. movements/scripts/citizen.lua..
And you have Oracle example in TFS0.3.3.. npc/The Oracle.xml
So you should make teleport leading to your town, and set it's actionid to 30020 + TownID, for example for city tiwh townid 3 you have to put 30023 acionid.