First you define to local vars
x and y the x-coord and the y-coord of the spell target location, ok? Then, evertime you want to move the unit, you check if the unit is in range of maybe 20 of these coords, if yes, don't move the unit, else move it, ok?
Any more questions.
Are you able to write in jass??
That would help much