>get key
Taken.
>open door
It seems to be locked.
>open door with key
You unlock the wooden door

Maybe you could get them to do some logic that lets a player use “open door” as a viable command if they already have the key? (Not that I’ve ever used Inform 7, so that might be trickier than it sounds…)