Before you get too carried away I would get it idling at home and go through every connection you can safely access and give them a gentle wriggle.As others have mentioned it could be a bad connection or even a broken wire inside the insulation. I recently found a loose ground connection below the fuse box on mine I didn't have any issues as such but this sort of thing could be the cause of your pain.
I would also be checking the plug connection and other connections on and around the ECU behind the glovebox.This should only take a hour to go through but you may get lucky.

