Intiate function as soon as button is pressed, not loop it over and over.

However the issue is when I press the SELECT button (in the switch case statement in void loop) whatever follows constantly gets repeated and doesn't run once.

All that is in the SELECT case is commented out. How can you tell that it executes more than once?

Where do you reset buttonPressed? Now, perhaps, you can see why readButton() should return a values, instead of diddling a global.