Two loops or branches help needed

There is actually more code during the millis time, an If statement makes a decision for the rest of the program.
Yes the first delay 91000) is to let the sensor settle.
Thanks