Call press and hold button via blueprint

You can simply open the Gate when you press the key, and close it upon release.

Or set a bool wariable to True/False, and do what you need while it is True.