My code doesn't work.

    if ((LED1 == HIGH) && (currentMillis - previousMillis >= OnTime))

2 lines previously you read the state of LED1 (or at least try to) and throw away what is returned. Then in the line above you test the value of the LED1 pin not the state of the pin.

Have you tried compiling the program ?
Several errors are reported