Please modify your post to post code properly. First delete all the code from your post. Start the IDE, if it is not running. Use Tools + Auto format to make the code presentable. Delete the extraneous white space. Then, select the # icon and then paste your formatted code.
If you put each { on its own line, I think you'll find the structure of the program easier to see/understand. Certainly the extraneous curly braces will be easier to see. Delete them.
Consistency in naming variables will help a lot:
val1 = digitalRead(switchPin1);
val2 = digitalRead(switchPin2);
button0 = digitalRead(switchPin3);
Why switch from the poor val to the ever worse button prefix? You have switches attached to the Arduino and buttons attached to shirts.
delay(100);
That's an incredibly long time for a switch to bounce.
if (button0 != buttonState1)
Really, now, names like currState and prevState make it clear what is being compared here. button0 and buttonState1 do not.
the above programme hangs inthe middle from swithpin4 hangs
How do you know this? There are no debug outputs that indicate that you are properly reading any switches, or where the program is getting to, or what it is doing.
You are not activating the internal pullup resistors, so external resistors are required - either pullup or pulldown. Which do you have? How are the switches wired?