Have you checked the plug wires? I’ve had similar issues when the wires have gone bad—they just wear out over time. Thing is, they don’t always ''look'' bad, so you can’t just eyeball ‘em and call it good.
One way to check: pull into a garage or shed and turn the lights off, or wait until night if you don’t have an indoor place. With the engine idling, spray window cleaner on the wires. If you get pops or the motor misses, the wires need to be replaced. Hey, it’s a cheap replacement. Just do them one at a time so you don’t get the wires crossed (you think it’s running rough now, try swapping a couple plug wires).
The “check engine” light usually indicates a problem with the EGR (exhaust gas recirculator, might be called PCV on older vehicles). If it’s clogged up, it could also be causing rough running/power loss.