I'm having problems checking if the button is being pressed and dividing the delay timer properly.
Essentially, in the beginning, the Green LED should be on followed by a delay timer of 20 seconds. I need to be constantly checking the value of the delay timer. and check if a button is being pressed every 0.5 seconds, in which if so, the remaining time should be cut in half. For example, if the remaining time is 8 seconds, if the button is pressed, it should be 4 seconds now. Once the timer is finished, it should turn on the Red LED next for 10 seconds.
As @Perehama stated your program will be only as responsive as your longest delay() call.
How is your button wired? Your code implies you have a pull-down resistor. I recommend you wire your button like this and use INPUT_PULLUP:
To detect a button press look at the following tutorial: StateChangeDetection
btnState never changes in the following while loop so it may be stuck there forever.
while (timeLeft > 0) {
delay(500);
if (btnState == 1) {
timeLeft = timeLeft / 2;
//delay(timeLeft);
}
delay(timeLeft);
}