need help as iam newbee this programe is hanging on the middlle some times runs

Why do you look for a high here:

if (button0 == button1) {
if (button0 != buttonState1) {
buttonState1 = button0;
if (buttonState1 == LOW) {

but a High here?

if (button2 == button3) {
if (button2 != buttonState2) {
buttonState2 = button2;
if (buttonState2 == HIGH) {