Would be cool if alignment and size space mode could check if you are painting in 3d viewport or 2d viewport and adjust accordingly. Tangent wrap/object for 3d, UV and texture for 2d.
Manually change it back to tangent wrap, as you change it to texture now everytime you want to paint on UVs. I think this would be really useful, I 99% never would want to use another mode when painting over UVs
It would need to be a toggle, like in the section where you normally manually change it back and forth, you could toggle "smart alignment". i think by default it would be set to on because, like mentioned, why paint on UV's any other way? but of course there is always edge cases where it is good to leave user control.
that stuff isn't exposed to the scripting API unfortunately, submit a feature request to allegoritmic, they're fairly responsive the immediate counter to your suggestion is 'what should happen if you don't want that behaviour?'