The wifes 03 expo 4.6 did the same thing. Shook and very rough idle, would die but restart. Away from idle it was fine. Reading forums found the problem is common to a vacuum hose from valve cover to back of manifold.
The daughters 94 mustang had the same thing. CEL lean bank 1 and 2 went right to looking for a vacuum leak. Same area, vacuum hose that connects to back of manifold.
The sons 96 ranger is fine so far. But if rough idle comes up, a vacuum leak is the first thing i look for.
This is somewhat common.