Hm... I could have sworn that PS has pixel based scripting. Looks like I may have to do some research...

Yup. I just confirmed it. PS has full pixel based scripting using Java it looks like. It has classes for every element in the window down to the pixels themselves apparently. Never tried it, but I knew it could be done.