i have a script like that except it is locked door.
so when you go through the door once it is autodoor but when it closes it switches to a door that needs a key.
i used it to make it look like my prison guard had a key.
;Artificial Intelligence Script
;Header
desc = Auto Proximity Door and key (Open and Close)
;Triggers
:state=0,anywithin=75:state=1,setframe=0,sound=$0,
:state=1:incframe=0
:state=1,frameatend=0:state=2,coloff
:state=2,anyfurther=100:state=3,sound=$1,colon
:state=3:decframe=0
:state=3,frameatstart=0:state=4,setframe=0,
:state=4:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\lockeddoor.tga,hudname=keydoorprompt,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=60:hudshow=keydoorprompt,hudfadeout=keydoorprompt
:state=10,plrdistwithin=60,plrhaskey=1,plrusingaction=1:state=1,setframe=0,sound=$0
:state=5:incframe=0
:state=5,frameatend=0:state=6,coloff
:state=6,plrdistfurther=60:state=7,sound=$1,colon
:state=7:decframe=0
:state=8,frameatstart=0:state=10,setframe=0
;End of Script
sorry if all my post annoyed anyone, didn't know i was a hassle