sensor 4 sec delay then turn on relays

Take a look at the Blink Without Delay Example in the Arduino directory.

Basically, when you want to do something a certain time later, you get the current millis() value and put it into a variable, then each time through loop(), you check to see if that the current millis() value minus the value in the start time variable is equal to, or greater than, the desired duration.

Any variables you use for these values should be of type unsigned long