Op-Amp transient modeling
If you use an "analogue switch" and feed it from the same supply as the op-amp, you shouldn't have a problem with output transients from the op-amp. This is a tried and tested way of controlling gain on an op-amp circuit.

You need to locate a "switch" with low enough on resistance so that it doesn't significantly affect the value of R2 it is placed in series with. You can use several combinations of switches and different values of R2 to create several different gains also.