...something like this?

if (my.x, your.x < 500)//whatever you have
{
vec_set (temp.x, my.x);
vec_sub (temp.x, you.x);
vec_to_angle (you.pan, temp.x);
wait (1);
}