The O2 sensor fine tunes the air/fuel ratio at speeds above idle. A non-functioning O2 shouldn't have any bearing on idle quality, although they do have a finite lifespan, and if you're unsure of its age/mileage, by all means, replace it and fix your frayed wires. I honestly don't think it will fix the idle problem, but in the long run it will help MPGs, and promote a cleaner running engine.
You mentioned you cleaned the TB and IAC. Did you remove the IAC, and scrape out the pintle and oriface? Impossible to do unless disassembled. I don't know, but would a failing TPS give you the crummy slow speed/idle quality? I've never had this problem, so I'm taking a shotgun approach, maybe learn something myself...Good luck, let us know what you find.