Inserting IR sensor code into existing project

This additional information that is very important and changes the functionality compared to the description you have posted before.
Is this the final functionality that you want to have?

If Yes: you would insert an if-condition that checks for the IR-sensor-Input beeing high
pdeudo-code:
if (IR-sensor == HIGH)

digitalWrite(Red-leds HIGH)
digitalWrite(all other Leds LOW)

else // IR-sensor-Low
switch LEDS on/off as already programmed

best regards Stefan