Looping for each action

Hello Community! I am new in Arduino Programming and I have a problem.

What I wanna do is like to modes for a "traffic light". If the user in the Console writes 0 the yellow leds turn on and off, as at night. And if the user writes 1 the leds turn on and off as the traffic lights do in the day. The problem is that i have to write over and over again to do the action (0 or 1), what I want is a loop for each option (0 or 1) until the user writes 0 or 1.

The code:

const int LED_Rojo_1 = 13;
const int LED_Amarillo_1 = 12;
const int LED_Verde_1 = 11;
const int LED_Rojo_2 = 10;
const int LED_Amarillo_2 = 9;
const int LED_Verde_2 = 8;
int inByte = 0;
 
void setup(){
    Serial.begin(9600); //Open the serial port
    
    pinMode(LED_Rojo_1, OUTPUT);
    digitalWrite(LED_Rojo_1, LOW);
    
    pinMode(LED_Amarillo_1, OUTPUT);
    digitalWrite(LED_Amarillo_1, LOW);
    
    pinMode(LED_Verde_1, OUTPUT);
    digitalWrite(LED_Verde_1, LOW);
    
    pinMode(LED_Rojo_2, OUTPUT);
    digitalWrite(LED_Rojo_2, LOW);
    
    pinMode(LED_Amarillo_2, OUTPUT);
    digitalWrite(LED_Amarillo_2, LOW);
    
    pinMode(LED_Verde_2, OUTPUT);
    digitalWrite(LED_Verde_2, LOW);
}
 
void loop()
{
    if(Serial.available() > 0){
        inByte = Serial.read();
        Serial.println(inByte);
        
        if(inByte == '0')
        {
            loop{
            digitalWrite(LED_Amarillo_1, HIGH);
            digitalWrite(LED_Amarillo_2, HIGH);
            delay(1000);
            digitalWrite(LED_Amarillo_1, LOW);
            digitalWrite(LED_Amarillo_2, LOW);
            delay(1000);
            }
        }
        
        else if(inByte == '1')
        {
            digitalWrite(LED_Rojo_1, HIGH);
            digitalWrite(LED_Verde_2, HIGH);
            delay(9000);
            digitalWrite(LED_Verde_2, LOW);
            digitalWrite(LED_Amarillo_2, HIGH);
            delay(2000);
            digitalWrite(LED_Amarillo_2, LOW);
            digitalWrite(LED_Rojo_2, HIGH);
            digitalWrite(LED_Rojo_1, LOW);
            digitalWrite(LED_Verde_1, HIGH);
            delay(9000);
            digitalWrite(LED_Verde_1, LOW);
            digitalWrite(LED_Amarillo_1, HIGH);
            delay(2000);
            digitalWrite(LED_Amarillo_1, LOW);
            digitalWrite(LED_Rojo_2, LOW);
            
        }
    }
}

Hope you guys can help me!
Thanks!

PD: Sorry I do not speak english very well

if(inByte == '0')
        {
            loop{

?

Sorry i didn't erase that haha I was trying with that but didn't work.

Read through the first few pages of this thread: Timing trouble with millis() for LED control The OP in that thread wanted to do a similar thing as this, except using a button to change the flashing pattern instead of the Serial Monitor. The sketch he eventually ends up with makes that a very easy thing to change.

After about 7 pages or so the focus changes to power saving strategies and making a custom PCB, so you don't have to read through all 18 pages.