I assume, there is a function that controls the movement of the player.
I think, this function should check the status of player in each moment. When the function recognizes the proximity between the player and the key is 50 quants or less, then it have to set the relevant variable to store this state, perhaps in the my.skill1. From this point the action door will notice the change and will open the door, in my opinion.
I can imagine, may there are other solutions, so you don't need to accept this at the first sight. You can look up for other solutions, if it does not fit to your requirements. Or you can find a flaw in this logic...
Anyway, i hope this post helps you in your work.