Re Modder's answer, I am slightly puzzled. The overheat switch is connected at one end to the thermocouple inner where it is trapped in the valve body by the slotted nut, and connected at the other end to a spade terminal of the valve body. It is thus in series with the thermocouple across the valve solenoid (coil) so that, if the thermocouple fails, or if the overheat switch trips open, then the valve spring overcomes the unenergised solenoid and the gas is shut off. To remove the thermocouple and associated overheat switch connector from the valve body by unscrewing the slotted nut, then makes it very difficult to connect the exposed end of the thermocouple to the other terminal of the valve body as Modders suggests. It is perhaps easier to eliminate the overheat switch by shorting out the two terminals of the valve body to which the overheat switch is connected with a bit of wire and two croc clips, with everything else connected normally. If this solves it, the overheat switch is faulty. If it doesn't, the thermocouple or (since it is a new th'couple,) more likely its connections, relying on the slotted nut pressure, is at fault.
"Billyboy"
April 2008