When I press the main menu button, the menu opens, but I can continue to press the button.

well you need to add some blueprints nodes to hide/remove the interface after you have use it.

download this unreal free project, it has a lot of examples to make you start in learning blueprints. there is a section about user interfaces, after you have open the project use the Open Level from the editor menu and you will find a lot of levels with blueprint setups and examples