You appear to have exactly the same issues that I had. Suggest you go to the S-type BB and Club comment sections and see my posts on spark plug/ MAF / coolant temperature/ sensor issues.
Try this link to start with.
http://www.jec.org.uk/forums/viewtopic.php?f=193&t=5479
I suggest you go this way with the problem. Install a new set of plugs. Clean out the throttle body throat with carb cleaner, removing all traces of crank case breather oil residue to leave it spotless. The MAF sensor can be difficult in as much as an Autologic type interrogation does not always show a MAF that is on its last legs. I replaced mine even though it did not flag up when interrogated. Around £70 new but not much from a breaker as an experiment. Replacement did make a difference so I must assume that my MAF was past its best.
Start the car and let warm up. Go to the exhausts and listen to the engine note. The note should be even and you should hear bom, bom, bom, bom etc indefinitely if you do not have a misfire. Bom, bom, bom, POP, bom, bom, bom, bom, bom, bom, bom, POP, bom etc tells you that seven cylinders are firing ok in sequence, but the POP is the misfire. So you have one cylinder not firing. Two pops in a sequence of eight firings would suggest two cylinders at fault etc. If you listen intently to the exhaust note, it is possible to hear the pulses and count them.
If you remove the spark plug covers, this will access the plug on coils which are held in place individually with a 7mm headed x 25mm bolt. To disconnect a coil, depress the 12v DC plug tab on the connector and pull the connector off the coil. Remove the 7mm bolt and pull the coil off the spark plug. A new coil or number of coils can be changed in this way. A good way to find out which coil or plug is at fault is to individually remove each connector on each coil in turn. Switch off the engine on each occasion you disconnect a coil to avoid risk of a 20k volt belt from a coil. Insulation can break down allowing high voltage to squirt out of any cracks in a broken coil case. That voltage would take the shortest path to ground via your fingers! Check also that the spark plug well and rubber coil boot are not full of engine oil. If the are, that will also cause misfires. The only remedy is to change the cam cover "spectacle" oil seals to cure the leak. See Brake Busters V8 article in the July 2012 magazine for details.
If when you disconnect each coil in turn the engine note becomes even more uneven and even more pops are heard from the exhaust, you may reliably assume that that coil was ok. If there is no change in engine running and you still popping away without the engine note changing, then you may assume you have found a duff coil or spark plug. It sounds as if you have one or more coils gone, so perhaps buy at least one new coil which you could substitute in turn with each coil on the car, until you find the offending broken down unit. However your friends interrogation equipment is perhaps a quicker way of finding which coil or more might be defective.
Spark plugs misfire when worn. I have found on an S-type V8 which shares its engine with XJ8 and XK8 models, that worn plugs tend to misfire at around 1600 and 2300rpm. Duff coils begin to show early signs of failure when pulling up motorway inclines on light throttle and then coughs and splutters begin with a loss of torque. The car feels nasty to drive and as the coils continue to break down, pops can then generally be heard and felt at idle speeds when stationary. One also finds that the car is reluctant to accelerate cleanly and generally becomes irritable and drives like a bag of poo!
I`ve just replaced just one coil the other evening. Joy of joy! Instant fix with the car running like a sewing machine again with a nice even exhaust note again.
In addition to the above, a defective cylinder head coolant temperature sensor mounted within the front coolant manifold and the ambient air temperature sensor in the throttle body plastic trunking can also upset fuelling and ignition systems. I know this from recent experience. Both sensors are around £13 new. Mine began to fail at around 75k miles. Replacement of these and the other sensors listed above, even if found "ok" when interrogated, often produce improvements in engine running although still seen as ok by an interrogation programme. So a few hints here for you.
The ali thermostat tower cap seal is not good really. It is supplied with an o-ring which can get badly crushed and mis-shapen when the cap is tightened down. The top edge of the tower is very sharp and this is what can wreck that somewhat inappropriate seal ring. Not brilliant at all and the ali towers worst design feature. The remedy is simple. Replace the o-ring with a fibre washer and the leaks will stop.
Hope that helps. there is a cause and a reason for each issue. Just a question of finding it!
Mike