I feel like this is now a different problem from what you were talking about before ![]()
Okay... So you have two modes Loop Mode and Edit Mode.
In Loop Mode button 1 short press does relay1, button 2 short press does relay2
In Edit Mode button 1 activates a menu, button 2 increments a counter.
In Edit Mode a long press toggles between Loop Mode and Edit Mode
Did I get it correct?