My wifes ML had a simialr series of events about a year ago and was covered by warrantee. The problem as I saw it was that the controllers software for adapting its missfire counter was malfunctioning or just inadaquate. The adaptation involves something called sensor ring adaptation. To understand, one must understand how the controller IDs a misfire.
It does this by watching the acceleration rate of the crankshaft. The highest acceleration is after each firing. Extraneous considerations are the driveshafts (as harmonics can decelerate the crank), harmonic balancer, flywheel, etc. The original ECU had 5 adaptation zones (engine speed versus load). The new one had 18 (newer software for the same year -1998) zones.
Before the ECU was replaced the sensor ring adaptation was redone and the problem went away for almost a month.
The misfire strategy is to shut off the fuel after a misfire has been IDed, so if once IDed the engine continues to misfire till the key is cycled.
Engine management ECUs are covered under a 8 year 80,000 mile emissions warrantee BTW.
Bosch Master, ASE Master, L1
33 years MB technician