Looking to optimize this code and add a loop
You could use a for loop so you don't need to repeat the yellow blinking led code 7 times.
To keep the red leds alternating, you use a while loop.
int switchState = 0;
int green = 3;
int yellow = 4;
int red1 = 5;
int red2 = 6;
int button = 2;

void setup()
{
  pinMode(green, OUTPUT) ;
  pinMode(yellow, OUTPUT) ;
  pinMode(red1, OUTPUT) ;
  pinMode(red2, OUTPUT) ;
  pinMode(button, INPUT) ;
}

void loop()

{ //start void loop 1
  switchState = digitalRead(button);

  if (switchState == LOW)         //button not pressed
  {
    digitalWrite(green, HIGH);      //green LED on
    digitalWrite(yellow, LOW);
    digitalWrite(red1, LOW);
    digitalWrite(red2, LOW);

    delay(500);

    digitalWrite(green, LOW);     //blink green LED

    delay(500);
  }//end if

  else        //Button pressed
  {

    digitalWrite(green, LOW);
    digitalWrite(red1, LOW);
    digitalWrite(red2, LOW);

    //Blink yellow LED for 3 sec
    for (byte i=0; i&lt;7; i++)
    {
      digitalWrite(yellow, HIGH);   
      delay(250);
      digitalWrite(yellow, LOW);
      delay(250);
    }


    // alternate the two red leds, while the button is pressed  
    while (digitalRead(button) == HIGH) 
    {
      digitalWrite(red1, HIGH);
      digitalWrite(red2, LOW);
      delay(250);

      digitalWrite(red1, LOW);
      digitalWrite(red2, HIGH);
      delay(250);

    }     //end while loop

  }     //end button press

}     //end void loop