:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecoretextpressentertouse.tga,hudname=usedoorprompt,hudhide=1,hudmake=display,state=11
:state=11:hudreset,hudx=50,hudy=90,hudimagefine=gamecoretextlockeddoor.tga,hudname=keydoorprompt,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=60:hudshow=usedoorprompt,hudfadeout=usedoorprompt
:state=10,plrdistwithin=60,plrusingaction=1,activated=0:state=1,setframe=0,sound=$0
:state=10,activated=1:state=12
:state=1:incframe=0
:state=1,frameatend=0:state=2,coloff
:state=2,plrdistwithin=60,plrusingaction=1:state=3,sound=$1,colon
:state=3:decframe=0
:state=3,frameatstart=0:state=10,setframe=0
:state=12,plrdistwithin=60:hudshow=keydoorprompt,hudfadeout=keydoorprompt
:state=12,plrdistwithin=60,plrhaskey=1,plrusingaction=1:state=1,setframe=0,sound=$0
Something like this is your best bet. The player can open it and cose it as much as they want, but as soon as the player enters the zone, the door needs the key.