millis with random switching question

For your application I doubt it will matter but this...

millis() >= waitUntilb

...is not a reliable way to mark time.

Comparing unsigned values (return from millis) with signed values is not good...

long waitUntilb=0;

The wait* variables need to be unsigned long.