For the parts where I break off my rails in my World Idoc Traveler script, I simply record where my character is and assign a variable to the xy location. Then go and do stuff, then just 'move' or 'pathfind' to the recorded xy position and run the rail from there. Something along the lines of this:
sub DoOtherThingsOffRail
call %railsubs TM_SetPresentServerCommand STOP
set %returnX #charposX
set %returnY #charposY
; go do stuff
move %returnX %returnY 2 ; or pathfind
call %railsubs TM_RunRail railname present end direction
return
Not exactly like I have it in my WIT script, but you get the idea. Before I decide on where I stop the rail, I use one of two methods on how I'll stop it. I'll either monitor the character xy position, or check the current waypoint the character is at. I haven't implemented the 'Gotoclosestglobalwaypoint', but if you know where you are, and where you want to go to, there's really no need for it.
Using callback are tricky indeed as TrailMyx described, but to start out, I'd recommend using them in strict moderation. I use it atm only once while truly running a rail, and all I have it do is open a set of doors. It's still not as smooth as I'd like, but those plans for tightening all the rails in my WIT script are a little ways away yet.
Please, if anyone here needs any extra ideas or examples, give me a hollar !
And ty TrailMyx once again for this incredible tool, without it, my WIT script wouldn't exist.