How to enable key after triggering a box trigger

one way would be to use a gate to control the flow of the script as shown below in a picture. the gate will only allow the enter pin to be executed when the gate is set to open, so in the example when the actor is overlapped by the player character the gate opens and the tab key works, then when the player ends overlapping the actor the gate closes and the tab key stops working. this type of thing could also be done with variables and branches as well.