The magic wand does auto selection for contiguous areas with a single click, so you don't have to do draw any lines so it's easily scriptable, the problem is that it doesn't take care of enclosed letters (for example the middle of the letter "o") would still have the darker color. (It also has other problems, like problems with gradients, so this isn't the best solution).
The color selection tool can be tweaked with a threshold to avoid the problem you are referring to. It actually works really well so there is no subtraction around the black text but the shadow is removed. It definitely does remove that particular color (or range) if it's in the page, but that occurrence is rare enough that it makes it the best solution so far. Now again, this is with the black paper behind the page. I have done a color selection and remove without the black paper but because the color isn't so uniform in the shadow, the results are not as good. In this case, I think I had more success with clipping the high end with the 'levels' tool than removing a particular color range with the color selection tool.