1. you calculate the trace target wrong:
Code:
vec_set(trace_target,vector(1000,0,0));
vec_rotate(trace_target,player.pan);
vec_add(trace_target,player.pan);


2. using trace the door should react on "EVENT_SONAR"
add the trace flag "ACTIVATE_SONAR" to your c_trace instruction to be able to use it.