If the switch worked at one point in time without issue, I doubt the issue is actually the switch itself. I recommend disconnecting the switch wires from the two outer terminals on the valve. With the pilot lit and the control knob moved to the On position, touch a jumper wire to the two outer terminals to confirm that the issue isn't a defective switch. If the burner flame ignites without issue after jumping these terminals several times, the switch would be the culprit. If the same issue happens when jumping the two outer terminals with a jumper wire, the thermopile isn't generating sufficient millivoltage to open the main valve plunger. I recommend having the gas log set serviced.
on October 15, 2019