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.
2016 Ford Fusion SE (1.5L Ecoboost)
2015 Ford F-150 Lariat Supercrew (3.5L Ecoboost)
2010 Lincoln MKZ (3.5L DOHC)
2007 Ford Focus SE (2.0L DOHC) A.K.A. "Zippy"
2004 Ford Freestar Limited (4.2L OHV)
Generac 17.5KW Generator (33HP Twin Cylinder)
Farm Hand 60 Gallon Compressor (3 Cylinder)
AMSOIL in everything I own that I can get it in...
"Have a good day, and a better one tomorrow"