when the door opens, C1 is charged to maximum. when the door is closed, the capacitor will start discharging through T4 slowly. The rate of discharge is controlled by the potentiometer R4. The transistor T1 will conduct as long as the capacitor's voltage is above 0. This transistor keeps the lamp grounded (like the door switches do) as long as the capacitor is charged. Moreover, as the voltage of the capacitor falls, the base current of the T1 falls as well, and so does the collector current of the transistor. Therefore, the lamp dims slowly.