Your loop checks the value of the variable buttonvalue. But that variable doesn't get updated inside the loop, only outside. So when the code goes into the loop, it can never get out again.
Avoid using while{. . .} as it can lead to blocking code.
HIGH and LOW are not very documenting, PUSHED/RELEASED are more so. #define PUSHED LOW #define RELEASED HIGH or #define PUSHED HIGH #define RELEASED LOW
Learn how to make and use non-blocking TIMERS using millis().
Lastly, scan your swtitch(es) every 50ms to handle switch bouncing.
The button is checked, then maybe one cycle of blinking is executed before… the button is checked, then maybe one cycle of blinking is executed before… the button is oh well you get the idea.