so you want random movement when you get within range they follow you if you get out of range they go back to random movement
i just updated it so it runs better use \c[range,target] for chasing events better defined in the instructions
edit typo fix