3 input (on/off/off with delay) to control 1device using ESP8266 as Web Server
You have various logic problems:
You block until WiFiClient has bytes available. Everything comes to a stop. So if you send a &quot;/delay&quot; command, it will receive and parse that command, turn on the device, then block again, indefinitely, until you send another command. Once you send another command, it will check the interval ONCE, and then lock up again. You need to rewrite your loop to check for bytes, read them if found, and do other work (like checking your time interval) if no bytes are available.
Next, your timing code is a mess. You only ever set currentMillis and previousMillis at the same time, so they will never be different. And you only ever check the times once when you first detect a &quot;/delay&quot; command.
Instead, refactor your logic. Only set previousMillis when you first detect the delay command, and then only compare if previousMillis to currentMillis if  previousMillis is not 0:
if (req.indexOf(&quot;/delay&quot;) != -1)
{
    previousMillis = millis();
}

if (previousMillis != 0 &amp;&amp; millis() - previousMillis &gt;= interval) {
    digitalWrite(device1, LOW);
    previousMillis = 0;
}

(Also note that you were declaring a second, independent variable  previousMillis inside your if statement, which only exists inside the curly braces for that if statement. Don't do that. Use the existing global variable you defined, as I show in my edited code.)