Just
If Ref.getlocked
door is locked, so do something
else
door is unlocked, do something else.
Unless you get really complicated, you'll need a script on the door anyway with an Onactivate block, so you can skip the ref and just use "if getlocked", I think.
Is it skipping the onactivate block and going directly to the lockpick menu or something?
By the way, since your questions keep getting moved to the CS forum, why not post them there in the first place?