This circuit, enclosed in a small box, is placed in the fridge near the lamp (if any) or the opening. With the door closed the interior of the fridge is in the dark, the photo resistor R2 has a high resistance (>200K) thus clamping IC1 by holding pin 12 high. When a beam of light enters from the opening, or the fridge lamp lights, the photo resistor lowers its resistance (<2K), pin 12 goes low, IC1 starts counting and, after a preset delay (20 seconds in this case) the piezo sounder beeps for 20 sec. then stops for the same lapse of time and the cycle repeats until the fridge door closes. D2 connected to pin 6 of IC1 makes the piezo sounder beeping 3 times per second.
Connecting D1 to pin 2 of IC1 halves the delay time.
Delay time can be varied changing C1 and/or R3 values.
Any photo resistor type should work well.
Current drawing is insignificant, so SW1 can be eliminated.
Place the circuit near the lamp and take it away when defrosting, to avoid circuit damage due to excessive moisture.