Paulonius is correct, the best way is to use move instead of pathfind, as pathfind tries to follow the cursor, so you have to leave the cursor close to your character to avoid trying to run. I wrote a script to randomly stealth around my house plot just a week or two ago and ran into this same problem, with move being the fix over pathfind.