Verify a code for Traffic Signal
There is nothing wrong with your code. But it could use some cleaning to make it efficient. 

The code at the moment will be 'deaf' to any user inputs for twenty seconds between light changes.

This can be fixed by using a timer interrupt and changing the lights every 20 seconds and listen for other inputs or do other things. You can use the arduino timer library, this is well documented and you should be able to find examples of its use. Basically you would monitor a variable until it reaches a point and then trigger the lights.

The other option would be to use the millis() and every 20 seconds change a light, but do stuff between those 20s. This can be done like this:

unsigned long previousMillis;  //hold the previous time
unsigned long currentMillis;   // hold the current time

long threshold = 20000;
int count = 0;

int pins[] = {13, 14, 15};

//setup code stuff

//put the following at the top of loop()

currentMillis = millis();

if(currentMillis - previousMillis &gt; threshold){

    previousMillis = currentMillis;

    for(int i = 0; i &lt; 3; i++){
    digitalWrite(pins[i], LOW);  //turn off all

    }

    if(count &gt; 2) count = 0;

    digitalWrite(pins[count], HIGH);

    count++;
}