I assume the engine was not running... if it was sitting at just the right spot on the pickup where it was about to trigger or not it might be randomly sparking...

I would try pulling the trigger and see what it does.

Also I would not be playing around with the wiring with the MSD box on... could be asking for shocking events...