For idle Check your pcv valve clean and blow in it ,should only blow one way. The old trick is to make an engine cut out switch by earthing the distributor so no one can steal the car , maybe one of your cables shorting out some how around the distributor, even cracks or a seal letting water in , Worth a check.