You could try adding vec_dist to the code:

Original:
Code:
while(1)
{
if ( my.status == 1)
{
c_move (my, vector(10, 0, 0), NULL, GLIDE);
run_percentage += 6 * time_step;
wait(1);
}
wait(1);
}



To:
Code:
while(1)
{
if ( my.status == 1 && vec_dist(my.x,target_pos.x)>= 10)//Where 10 is the distance you want instructions to be executed
{
c_move (my, vector(10, 0, 0), NULL, GLIDE);
run_percentage += 6 * time_step;
wait(1);
}
wait(1);
}



Now when entity is close than 10 quants of target_pos it'll stop the movement