Running a loop inside of an else if statement while using serial command inputs

Hey there everyone, I watched a youtuber a couple of days ago and I followed the hardware and software that was written. The difference is that I implemented 6 LED lights instead of 3 and everything is working correctly. The one issue I'm currently having is on my line that states light show which is an else if statement, I have my 6 lights follow a certain pattern but I want it to loop 10 times without having to copy the HIGH LOW in the "digitalWrite" for 10 additional sets of lines of code which seems extremely inefficient to me. Is there any way to incorporate a for loop inside of an else if loop so that I can just run the loop that way? Any help that can be provided will be greatly appreciated. I wanted to note that I code each light to a number in the programming pins on my Arduino uno, which I use a wire to hook up to a 220 ohm resistor which hooks to the power pin of my LED, I then have a cable going from the negative side of the LED which then returns to the ground strip which is hooked up to ground on the unit. I went ahead and left a comment above the else if statement explaining what I want to do inside of it. Below is my code.

String command;

#define yellow1LED 8 
#define green1LED 9
#define red1LED 10
#define yellow2LED 11
#define green2LED 12
#define red2LED 13

void setup() {
  Serial.begin(9600);
  pinMode(yellow1LED, OUTPUT);
  pinMode(green1LED, OUTPUT);
  pinMode(red1LED, OUTPUT);
  pinMode(yellow2LED, OUTPUT);
  pinMode(green2LED, OUTPUT);
  pinMode(red2LED, OUTPUT);

  delay(2000);

  Serial.println("Type Command (yellow, green, red, light show, all, off)");
}
void loop() {
  if (Serial.available()) {
    command = Serial.readStringUntil('\n');
    command.trim();
    if (command.equals("yellow")) {
      digitalWrite(yellow1LED, HIGH);
      digitalWrite(green1LED, LOW);
      digitalWrite(red1LED, LOW);
      digitalWrite(yellow2LED, HIGH);
      digitalWrite(green2LED, LOW);
      digitalWrite(red2LED, LOW);
    }

    else if (command.equals("green")) {
      digitalWrite(yellow1LED, LOW);
      digitalWrite(green1LED, HIGH);
      digitalWrite(red1LED, LOW);
      digitalWrite(yellow2LED, LOW);
      digitalWrite(green2LED, HIGH);
      digitalWrite(red2LED, LOW);
    }

    else if (command.equals("red")) {
      digitalWrite(yellow1LED, LOW);
      digitalWrite(green1LED, LOW);
      digitalWrite(red1LED, HIGH);
      digitalWrite(yellow2LED, LOW);
      digitalWrite(green2LED, LOW);
      digitalWrite(red2LED, HIGH);
    }
//I want this "light show" to loop 10 times inside of this else if statement
    else if (command.equals("light show")) {
      digitalWrite(yellow1LED, HIGH);
      digitalWrite(green1LED, LOW);
      digitalWrite(red1LED, LOW);
      digitalWrite(yellow2LED, HIGH);
      digitalWrite(green2LED, LOW);
      digitalWrite(red2LED, LOW);
      delay(500);
      digitalWrite(yellow1LED, LOW);
      digitalWrite(green1LED, HIGH);
      digitalWrite(red1LED, LOW);
      digitalWrite(yellow2LED, LOW);
      digitalWrite(green2LED, HIGH);
      digitalWrite(red2LED, LOW);
      delay(500);
      digitalWrite(yellow1LED, LOW);
      digitalWrite(green1LED, LOW);
      digitalWrite(red1LED, HIGH);
      digitalWrite(yellow2LED, LOW);
      digitalWrite(green2LED, LOW);
      digitalWrite(red2LED, HIGH);
      delay(500);    
    }

    else if (command.equals("all")) {
      digitalWrite(yellow1LED, HIGH);
      digitalWrite(green1LED, HIGH);
      digitalWrite(red1LED, HIGH);
      digitalWrite(yellow2LED, HIGH);
      digitalWrite(green2LED, HIGH);
      digitalWrite(red2LED, HIGH);
    }

    else if (command.equals("off")) {
      digitalWrite(yellow1LED, LOW);
      digitalWrite(green1LED, LOW);
      digitalWrite(red1LED, LOW);
      digitalWrite(yellow2LED, LOW);
      digitalWrite(green2LED, LOW);
      digitalWrite(red2LED, LOW);
    }

    else {
      Serial.println("bad command");
    }
    Serial.print("Command: ");
    Serial.println(command);
  }
}

Here, have a few of these
\n
\n
\n
\n

I’ve got more if you run out.

I'm confused, are you saying I need to add more \n inside of the "command = Serial.readStringUntil('\n');"
This seems vague to me.

No, I mean your description needs more line breaks.

Have a look at for - Arduino Reference

For loops are really good at repeating things.

Steve

What people are telling you is "just try it", it's software and flexible so you can try different things all you want.

Paul