I had a similar situation, mine truned out to be the crank position sensor wires got too close to the exhaust manifold, burned some of the wire loom and then it would get hot, melt the insulation and short out, when it would cool down it would start back up. I just spliced in a new section of wire around the bad spot and tied it back up away from the eshaust, problem solved.