It would be something like:
desc = keypad script by Marc Steene
:state=0:state=1
:state=1,plrdistwithin=80:state=2
:state=2,scancodekeypressed=X:state=3
:state=3,scancodekeypressed=X:state=4
:state=4,scancodekeypressed=X:state=5
:state=5,scancodeleypressed=X:activateifused=1,state=6
:state=6:state=6
:plrdistfurther=80:state=1
Add that script to the keypad entity, and set the IfUsed to the door name (with the remote script set). No idea if this will work, I just wrote it quickly
[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21