OK... working and tested

Be sure to add my.enable_scan = on; and my.enable_detect = on; to player's action.
Code:
function sentry_turnto(angle)
{
angle = ang(angle - MY.PAN);
if (angle > 10) {temp = my._speed;}
else{
if(angle < -10){temp = -my._speed;}
else{temp = my._speed * angle * 0.1;}
}
MY.PAN += temp * time_step *2; //playe with this value to turn faster/slower
}
function sentry_event
{
if(event_type == event_detect) &&(you == player)
{
vec_diff(temp,player.pos,my.pos);
result = vec_to_angle(my_angle,temp);
sentry_turnto(my_angle.PAN);
}
}
function sentry_fun
{
my.enable_scan = on;
my.enable_detect = on;
my._speed = 2;
my.event = sentry_event;
while(me)
{
c_scan(my.x,my.pan,vector(120,40,1000),SCAN_ENTS | SCAN_LIMIT | IGNORE_ME);
wait(1);
}
}
Cheers.
EDIT: Your sentry can pan around 360 dergees or should have some turn limit?
If yes I'll add something.
And for know it's only c_scan so I have to add trace, because c_scan working through walls.