Thanks for the advice. I ended up removing it during painting (that was kind of a no-brainer). After 3 coats of thinned paint on the metal grills themselves, I went ahead and lightly brushed-dabbed some of the paint on the foam as well. While I did end up with a couple of spots where the paint was probably too heavy (blocks a small portion of light when held up to the light), overall I am pleased with how it turned out and I don't feel the sound quality has changed much if at all, at least to my ears.
I did also conclude that the foam was intended to hide the drivers. Honestly, if I were to do it again I probably wouldn't bother painting the foam, at least not until I saw what it looked like in place. The speaker grill area is darker than my walls now anyway (using the exact same color wall paint), so the white background might have helped blend them in a little better.