Would it not be possible to get a keyway cut into the flywheel, using the witness mark of the sheared key to position it, and then use a loose key to align the two keyways? Assuming that the flywheel is a taper fit to the crank , it is the taper that does the work of keeping the flywheel in position, the key just provides the initial alignment.
There is, of course, the question of what caused the integral key to shear; the options being lack of torque on the flywheel retaining nut or an ignition fault causing a kickback, both options overcoming the grip of taper.
I’m guessing that your question about what actually triggers the spark on that electronic ignition system is one for the designers of the particular system to answer. Taking the Briggs and Stratton Magnetron system as an example , it has a visible additional trigger “pole” just before the coil pole pieces.