I just have to say, this script is awesome, and exactly what I needed. I had gotten to the point where I dreaded opening my inventory because it was so huge. After 2 runs of the script (the first one ended in an OOM error - an indicator of the enormity of my stockpile of junk?) and 12 hours, my inventory was tiny, I had made about 5 mil (off of junk - almost nothing in there was worth more than 20k), and I had discovered an IoTM I didn't even know I had. So thank you.
(I feel like someone in one of those "gold for cash" commercials. "I made 10,000 dollars selling my old and broken jewelery! Thanks gold4cash!!" *fans out bills*)