Does sound like an electrical connection gone bad. They can be a real pain, for example my intermittant charging issue from a while ago was this:-
Fuse looked fine from the outside and tested okay when tested normally, a voltage drop test when it was playing up found the problem and the fuse cover broke when trying to remove fuse.
Sorry but you're going to have to trace the fault, start by confirming that you loose spark when it wont fire (it does crank doesnt it?). id it does from there check for power to ignition system, stator and pickup coil tests when its not working.