Didnt read eaverything above .. but my tamer does something like that heres a stripped out to basics version
Sub Moveit ; Timeout , Movetox , Movetoy, Movetoz
Set !TimeOut ( #scnt + %1 )
Repeat
event pathfind %2 %3 %4
For !x 1 10
gosub Checkforwhatever ; Warning changing values of %2-4 will affect movement
set !Moved ( #CharPosX = %2 && #CharPosY = %3)
Until !Moved || !TimeOut < #scnt
Return !Moved