When you set input to UI Only, the Player Controller can no longer process input - that’s why the FlipFlop won’t fire again. The widget in focus has now the exclusivity and it should be the widget that shuts itself down and restores the appropriate input mode. Consider the following:
Player Controller
- opening the menu
Widget
- widget overrides
onKeyDown
(check the dropdown menu on the far left) - give the controller its input processing capability back
- removes itself from the viewport