Stopping flyback spark from inductor, but only some of the time
In the abstract, you could put a normally-closed switch in series with the reverse diode, just as the question suggests. By default, the closed switch allows the diode to act, and no spark is generated. To allow spark to be generated, open the switch. It might be necessary to add protections to the switch, especially if it's solid state. It might also be necessary to add circuitry to delay the current turn off long enough for the switch to close first, but this is not long.