New plugs have fixed the most obvious problem, the misfire at low RPM (thanks to Vocky). No visible reason why the old ones were failing, all looked clean and in good condition, but after a new set the engine settled down - not immediately but after a week on the road.
I still have the P0340 engine code though, it is very persistent. It often logs at very low speed (often <10 mph) and low RPM (<1500) shortly after starting the engine. I can reset the code and drive the car for hours with nothing then drive it for only a couple of minutes and the code is back.
Can anyone tell me what the P0340 code means in an engine with no cam shaft sensor?