Why would an iMac computer cause lights on a circuit to flicker when it goes into sleep mode?
A few things that can cause this:


Faulty iMac supply.
"Hot fault" in the wiring... A bad junction somewhere, or a physically damaged wire, or wires that are too small for the current draw (and the fuse or circuit breaker!).
Exotic interference.  Is there an electronic switch or timer, or a low-quality UPS, or one of those infernal "SpySmart Meters" somewhere?


Note that for items 1 and 2, you should see a voltage drop -- measured at the outlet that the iMac is plugged in to. A drop from 120V to 110V yields roughly a 16% drop in incandescent brightness.  A drop from 120V to 100V, causes about a 31% drop in brightness.



What iMac model is it? What specs does it list for power?  iMacs usually run at about 80W to 200W, but I read once that they can have short, peak draws of 1000W.

A surge protector will do nothing in this case, but a battery backup with brown-out protection will protect the computer and may lesson the flickering.



If it is a "hot fault" type problem, there is a very real danger of fire.  A fuse or circuit breaker cannot guard against such faults either, but you should immediately verify that the circuit breakers are properly sized for the wire gauge(s) of each circuit (the smallest wire gauge, if more than one was used).