Controlling op amp gain with an mcu, would this work?
Since you've run a simulation, go and do an AC sweep to see where the MOSFET capacitance starts to increase the gain (should be MHz, looking at it). 

Also, for high signal levels (greater than a few hundred mV input), with the MOSFET off, the MOSFET body diode will cause huge distortion on the negative half cycles. A change in bias could prevent that, but watch out for 'click' effects on gain change  if that is important to you.