using "while" in the setup

There is NOTHING inherently wrong with your approach to well defined task. (single button push ...)
That is one of the advantages of software - there are many ways to accomplish a task.
Saying that you should not do that is setup is defeating the flexibility of software solutions.

Checking buttons in Setup and then passing the results to loop is actually much better - you control the "wait" and NOT the "loop". But it is indeed a single shot at buttons.

There is only one thing you could change , but it is superficial and not really necessary.

The "while" monitors all of the buttons and when ANY of them is active the if's no longer need to read all of therm again.

Just checking for if(!buttonx) will suffice.

I cannot prove it, but the compiler probably "optimize" the if's and no longer checks all inactive buttons anyway.

Your problem is somewhere else and adding global variables or switch IS NOT a solution - just another way to skin a cat.

Good luck - I would look for loose connections, but tha's OF me.