Pause in the program for some time
Do not try to change millis(). Instead, record the last time the
second code (else statement) ran, and check whether that was more than
five seconds ago:

void loop() {
    static uint32_t lastRun;
    uint32_t now = millis();
    if (now - lastRun &lt; 5000) {
        // Some code
    }
    else {
        // Some code
        lastRun = now;  // record the time
    }
}


This is essentially the same technique used in the Blink without
delay Arduino
tutorial.