Haha okay. I have a tendency to write really buggy code and then slowly debug it over time. It always ends up working, but I NEVER do it right the first time.

In any case, here's your whole code, which should work like magic.

Code:
 
function c_ship
{
player = my;
my.scale_x = 1.0;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
while(1)
{
if(you == null)
{
c_scan(player.x, temp, vector(360, 60, 1000),ignore_me+ignore_you);
}
wait(-0.25);
}
}

function event_scn();
function got_target();

function f_ship
{
my.scale_x = 2.0;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
my.enable_scan = on;
my.event = event_scn;
}

var enemy_handle; // a global handle we can use for transferring pointers
function event_scn()
{
if (event_type == event_scan)
{
enemy_handle = handle(me);
ent_create("cross.pcx", my.x, got_target);
}
}

function got_target
{
my.scale_x = 0.1;
my.scale_y = my.scale_x;
my.oriented = on;
my.facing = off;
you = ptr_for_handle(enemy_handle); // now YOU is the enemy
while(you != null)
{
vec_set(temp,player.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp); // turn the target toward the player
vec_set(temp,nullvector);
temp.x = 20; // change this if you need to - the distance in front of the enemy
vec_rotate(temp,my.pan);
vec_add(temp,your.x);
vec_set(my.x,temp);
wait(1);
}
ent_remove(me);
}