I'm not sure but sounds electrical most random/intermitting problems are. But I've had similar symptoms and speedworks picked up it was my AFM. I've replaced it but its doing it again - (maybe a break somewhere along the circuit or lose pins). Could it be igniter? Best bet is to have it on a dyno to try and simulate problem with fuel pressure gauge, scope on your ignition, or a scanner to read engine faults.
Good luck mines giving me a headache although I've resoldered the pins on my old AFM and it seems to be fine (so far....)