I'm not too good at earlier version but you can try this:
has_walked = has_walked or {}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if not isPlayer(cid) then return true end
if has_walked[cid] then
doTeleportThing(cid, lastPosition...