Switching a relay on and off using "millis()" without interfering with the runtime of the other piece of code

What was the compilation error? Your "fix" put bRelay = false; back in the IDLE state (essentially erasing my correction.). You want to move that to RLY_HOLD, just before stateRelay is set to RLY_IDLE.