Maybe because your wait(1) is not in the while loop?
Code:
action blade()
{
  while (!player) { wait (1); }
  while (vec_dist (player.x, my.x) > 1000)
  {
    time_factor = 0.1;
    wait(1);
  }
}