The diode is there to ensure 1) that no current will flow from the primary battery to the base of the transistor and 2), to ensure that current will only flow through the trigger/base/emitter sections on the current induced as the magnet moves
away from the coil. There's a probably a 3), in that it forms a part of the environmental amplification of negative energy formed by the sharp gradient of the field reversal in the coil but I'm no expert on this technology.
