The ECU normally picks up any breaks in the wiring and flags up a fault code, even if it's an intermittent problem. :-/
I know we went over loads of possibilities before..
I would say on the face of it either faulty ignition components, poor mixture control - MAF sensor / lambdas perhaps? or maybe the crank sensor on the way out? I think we covered all of these before, though.
You said it often gets worse after a long period of idling. I wonder if the lambda sensors are cooling off? Then again, IME the ECU will pick up problems in this area and flag them up before they affect engine running.
I suppose if the MAF was also faulty, so open loop running was poor?...
Do you have access to a code reader that can report live data? Would be interesting to see if anything is noticeably different when it starts misbehaving? (MAF output, fuel trims, O2 sensor behaviour, coolant and air temperature, injector duration, battery voltage, etc.).
Kevin