so I've made these changes and its better. However, if I press into the door hinge, I go skyward still.

Code:
function open_doors() // this function is called by each door
{

	set(me, POLYGON | SHADOW);
	
	var door_swing_speed = 5;
	var closed_pan = my.pan;
	var OPEN_OR_CLOSED = 0;
	//	if (is(my.FLAG1)) {OPEN_OR_CLOSED = 1;my.pan+=90;closed_pan = my.pan-90;}
	
	VECTOR door_handle;
	vec_for_vertex(door_handle, me, 5);
	
	while(1){wait(1);
		
		if(vec_dist(door_handle.x, player.x) < 300 && my.pan == closed_pan){
//			set(me, PASSABLE);
			while(my.pan < closed_pan+90){wait(1);my.pan+=door_swing_speed;}
			SND_CREATE_STATIC(door_opens, door_opens_wav); // play the "door opens" sound
			snd_play(door_opens, 100, 0);
			//			door_sounds();  //runs the function for sounds below.
//			reset(me, PASSABLE);
			while(key_enter){wait(1);}
		}
		
	}
	
}