I think you hit it right on the head with the loose ground wire.
I had a similar issues when my F150 was brand new - the dealership kept telling me "it's a known problem - we're waiting for the engineering team to come up with a fix."
It turned out to be a loose ground. Love the truck but talk about annoying - and some real slackers in the service dept.
The ECM is under the hood, right in front of the firewall driver's side, above the battery. 4 harnesses plug into the backside of the ECM. You have to follow each harness for a foot or so, until you find a couple wires that head for the framerail just below it. Where they attach probably has corrosion. Hit them with WD40, loosen them, spin the ring connector loose, spray again, and tighten.
You really need FACTORY Shop Manual, not Chiltons / Haynes. And a multimeter. If not, mechanics will take your money. ALL OF IT - especially for electronics problems.
Electricity flow is just like water through a hose - just harder to see leaks. It doesn't flow through the wire, unless it has a place to go. And it can be IN the hose, but still won't flow...
And one more BIG difference - they don't TASTE the same, especially to the organic analog battery tester! Higher voltage = louder holler :L
I had this problem in my 85. Flickering dash at idle. Turns out I had not tightened the battery NEG cable. Just started by hand, never put the wrench on it. It still started and ran fine, but the dash flickered. Tightened the battery cables, and problem was gone.