First...I'm not a mechanic...so this may not be accurate. O2 sensors could cause it to miss or run rough...if an O2 sensor is going out, it could make it run rich or lean trying to suit the conditions the sensor thinks its reading.
Are you replacing the thermostat with a factory temperature thermostat? I think it's 195*F... on Dodge Dakotas, some of the trucks would throw a code for staying too cold for too long when people installed 160* thermostats in them in place of the stock 195*F thermostat...although that normally only happened on cold days.
Also, if it's staying too cold for too long...that could also be causing your miss...engine running extra rich trying to help it warm up. Unless you're putting too cool of a thermostat in it, I'm not sure why it's throwing that code...unless the O2 sensor can be causing it?