Definitely replace the O2 sensor. Believe it or not, my car did a strange ass thing when I had a bad O2 sensor. I had NO power until about 3k RPM's. I mean, I had the pedal pinned... and under 3k RPM's you could literally walk past my car. Took a good minute to get up to around 3K RPM's... and at that point, it would run like a champ. I have no idea why this happened.
Replaced the O2 Sensor, problem solved. I know this situation is different than yours, but you never know. It's always good to get rid of your CEL codes first. The CEL indicates a problem somewhere, in which those problems can cause the car to malfunction, and even cause other problems. I'd honestly replace the O2 Sensor before anything else, and get rid of that or any other CEL codes that you have.