Stair light on and off delay problem

Can somone take a look at this code. I have i stair with led stripes in every step and a ir sensor at the top and the bottom. I am using 3 potmeters to controll delay. Pot 1 controlls time between the steps to light up. Pot 2 controlls the time between the steps to turn off. Pot 3 controlls wait time before the steps strats to turn off.

The problem is that that i have to turn pot 2 and 3 to almost 0 to not get delay when i trigging irup.

const int analogInPin1 = A0;  // Analog input pin that the potentiometer is attached to
const int analogInPin2 = A1;  // Analog input pin that the potentiometer is attached to
const int analogInPin3 = A2;  // Analog input pin that the potentiometer is attached to
const int irup = 10;     // IR Beam at the bottom of the stairs
const int irdown = 3; // IR Beam at the top of the stairs
const int allon = 4;

int sensorValueOn = 0;        // value read from the pot
int sensorValueOff = 0;        // value read from the pot
int sensorValueOff2 = 0;        // value read from the pot
int outputValueOn = 0;
int outputValueOff = 0;
int outputValueOff2 = 0;

int led1 = 22;
int led2 = 23;
int led3 = 24;
int led4 = 25;
int led5 = 26;
int led6 = 27;
int led7 = 28;
int led8 = 29;
int led9 = 30;
int led10 = 31;
int led11 = 32;
int led12 = 33;
int led13 = 34;
int led14 = 35;


// variables will change:
int irupState = 0; 
int irdownState = 0; 

void setup() {
  Serial.begin(9600);

  // sets the digital pin as output
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  pinMode(led5, OUTPUT);
  pinMode(led6, OUTPUT);
  pinMode(led7, OUTPUT);
  pinMode(led8, OUTPUT);
  pinMode(led9, OUTPUT);
  pinMode(led10, OUTPUT);
  pinMode(led11, OUTPUT);
  pinMode(led12, OUTPUT);
  pinMode(led13, OUTPUT);
  pinMode(led14, OUTPUT);

  // sets the digital pin as input
  pinMode(irup, INPUT_PULLUP);
  pinMode(irdown, INPUT_PULLUP);
  pinMode(allon, INPUT_PULLUP);

}


void loop() {


  // read the analog in value:
  sensorValueOn = analogRead(analogInPin1);
  // map it to the range of the analog out:
  outputValueOn = map(sensorValueOn, 0, 1023, 100, 30000);


  // read the analog in value:
  sensorValueOff = analogRead(analogInPin2);
  // map it to the range of the analog out:
  outputValueOff = map(sensorValueOff, 0, 1023, 100, 30000);


  // read the analog in value:
  sensorValueOff2 = analogRead(analogInPin3);
  // map it to the range of the analog out:
  outputValueOff2 = map(sensorValueOff2, 0, 1023, 100, 30000);


  // read the state of the ir sensor value:
  irupState = digitalRead(irup);

  if (irupState == 0) {
    // turn LED's on:
    digitalWrite(led1, HIGH);
    digitalWrite(led2, HIGH);
    delay(sensorValueOn);
    digitalWrite(led3, HIGH);
    delay(sensorValueOn);
    digitalWrite(led4, HIGH);
    delay(sensorValueOn);
    digitalWrite(led5, HIGH);
    delay(sensorValueOn);
    digitalWrite(led6, HIGH);
    delay(sensorValueOn);
    digitalWrite(led7, HIGH);
    delay(sensorValueOn);
    digitalWrite(led8, HIGH);
    delay(sensorValueOn);
    digitalWrite(led9, HIGH);
    delay(sensorValueOn);
    digitalWrite(led10, HIGH);
    delay(sensorValueOn);
    digitalWrite(led11, HIGH);
    delay(sensorValueOn);
    digitalWrite(led12, HIGH);
    delay(sensorValueOn);
    digitalWrite(led13, HIGH);
    delay(sensorValueOn);
    digitalWrite(led14, HIGH);

  }





  if (irupState == 1
  ) {
    // turn LED's off:
    delay(outputValueOff2);
    digitalWrite(led1, LOW);
    delay(sensorValueOff);
    digitalWrite(led2, LOW);
    delay(sensorValueOff);
    digitalWrite(led3, LOW);
    delay(sensorValueOff);
    digitalWrite(led4, LOW);
    delay(sensorValueOff);
    digitalWrite(led5, LOW);
    delay(sensorValueOff);
    digitalWrite(led6, LOW);
    delay(sensorValueOff);
    digitalWrite(led7, LOW);
    delay(sensorValueOff);
    digitalWrite(led8, LOW);
    delay(sensorValueOff);
    digitalWrite(led9, LOW);
    delay(sensorValueOff);
    digitalWrite(led10, LOW);
    delay(sensorValueOff);
    digitalWrite(led11, LOW);
    delay(sensorValueOff);
    digitalWrite(led12, LOW);
    delay(sensorValueOff);
    digitalWrite(led13, LOW);
    delay(sensorValueOff);
    digitalWrite(led14, LOW);

  }


  // print the results to the serial monitor:

  Serial.print("sensor = ");
  Serial.print(sensorValueOn);
  Serial.print("\t output = ");
  Serial.println(outputValueOn);
  
 Serial.print("IRUP = ");
  Serial.println(irupState);
  Serial.print("IRDOWN = ");
  Serial.println(irdownState);





  // wait 2 milliseconds before the next loop
  // for the analog-to-digital converter to settle
  // after the last reading:
  delay(2);





}

When you feel the need to use numbers in variable names, you're overdue to learn about arrays.

Your problem is that you go through the lengthy switch-off-sequence every time you run loop() and irupState == 1. As long as your Arduino is sitting out all those repeated delay() calls, it won't react to your sensor. It also won't be reacting to the sensor if someone triggers it as the lights are switching off (the person has to wait until they're all off before they may start switching on again).

Solution:

  1. state change detection: only do the off sequence when the sensor output just became high, not when it already was high (same for the on sequence - same problem there). See state change detection example in the IDE.
  2. further improvement: turn your code into a finite state machine, using millis() based timing instead of the blocking delay(), so you can trigger the lights on while they are in the process of switching off. See e.g. this tutorial and the Blink Without Delay example.