intermittent misfires with check engine light coming on and then going off on 2000 Mercedes-Benz SLK230

Intermittent misfires, followed by check engine light coming on. Check engine light goes off after a while. Dealership replaced oxygen sensor valve but problem persists. They suggest the cylinder head be removed and cleaned out as the next step. Very expensive. Not sure if this isn't simply bad gas, which they supposedly checked and discounted.

Asked by for the 2000 Mercedes-Benz SLK230
check for vaccum leak in the intake system, loose or corroded ground wires, fuel pressure regulator, also have the codes read at your local autoparts store for free, find a good service center that looks for the problem before the medecine, cleaning the head will not solve this problem,
1 more answer
Check/ clean the maf sensor & its connector. Try spraying it with fast drying contact cleaner.