In your action handler function, you can scan over all the doors in your game to determine one of them is close enough, and then perform the “open door” action on that closest door if there is one.
If that seems not performant enough in case someone is spamming the button, you could run a loop that keeps track of the closest door to the player and updates it every .5 seconds or so. Then you can refer to that cached door value in your handler.