Can spray paint or a marker block UV for solder mask/resist?
Yes, black markers and black paint CAN block UV for photo-sensitive mask exposure. However there are two critical considerations....


IMAGING  How are you going to create the design?  For one-off crude patterns, you could manually draw the pattern with a black marker.  Not very accurate or repeatable, but maybe that is not required for your (undisclosed) project.  Spraying through a solder mask would seem problematic causing paint to remain in tiny holes, rendering the mask faulty.  Doesn't sound appealing to me. YMMV????
OPACITY vs. EXPOSURE  Unknown how UV opaque the marker or paint is? Always recommended to make "test strip" experiments where you work out all of the variables (including opacity and also photo sensitivity and exposure light strength, etc, etc.  Before attempting to make a real board.