Could be the coil pack since it's a 2004 and the coil is a wear item that breaks down over time due to excessive temerapure changes. Did you use dielectrical grease on both ends of the wires inside the boots? The P0316 code is for the Crankshaft Position (CKP) sensor. This could also be your problem. However, the coil is easier to replace and may need replacing anyways. My coil was causing hic-ups while driving at highway speeds that felt like tranny jolts. Have had no issues sionce replacing my coil 40K miles ago.
2015 F-150 Lariat Supercrew (Special Ordered)
2004 Freestar Limited 4.2 V6 w/Water Injection & Iridium plugs
2010 Lincoln MKZ AWD
2007 Focus SE
1979 Gilson 32" 10HP Snowblower
2007 Generac 17.5Kw Generator w/33HP Twin-Cylinder engine
Farmhand 3-Cylinder air compressor
AMSOIL Lubricants and Filters in everything
"Have a good day, and a better one tomorrow"