it will not hurt to replace the o2 sensor may even improve gas milage but I do not think that is the problem.
my girl friends car had a code for the aic and the o2 sensor.
I replaced the aic and bought a o2 sensor but have not had time to replace the o2.
the aic fixed her problem.
the o2 deals with the exhaust gases and the aic deals with the air idle control.
if you do decide to replace the o2 get a o2 socket. it will make your job a lot easier.