if interrupts are disabled, the result from millis() doesn't advance. The approach taken should be to check the SCB_ICSR_PENDSTSET_Msk bit and increment the tick count if it's set. This doesn't guarantee that millis() will advance as fast as it might if interrupts were enabled, but at least it will advance, and a tight loop based on millis() changing will terminate.