It's not really a matter of omitting an article. Grammatically, when you have one article, it's because there is just one noun phrase and a single article which comes before a single noun. This is because of the way conjunction works in language. When you combine several words or phrases with "and" or "or", you wind up with a single phrase of the same category as each of the things which were combined.
In your example "I will bring a pen, eraser, or pencil", when the three nouns "pen", "eraser", "pencil" are combined with "or", you get a noun (not a desk set), because the things you started with are nouns. Diagramming the structure, we have
[NP a [N [N pen] [N eraser] or [N pencil] ]
That is, "pen eraser or pencil" is a noun, so naturally it is preceded by a single article "a".
Alternatively, the same thing could be expressed with a NP which is a conjunction of three NPs, in which you naturally wind up with three articles, because each NP gets its own article:
[NP [NP a [N pen]] [NP an [N eraser]] or [NP a [N pencil]] ]
Similarly, for your example 3, there is a choice between using a single adjective formed by conjoining the three adjectives "black", "yellow", and "red", or a single noun formed by conjoining the three modified nouns "black shirt", "yellow shirt", and "red shirt".
Your example 4 is more complicated, since it is derived the preceding by Right Node Raising (RNR for short) by moving a single constituent shared by all conjuncts up higher in the structure.
I will select [NP [NP a black,] [NP a yellow,] or [NP a red,] shirt].
"shirt" is the node that is raised. It may be preceded by a comma, marking the intonation break that is heard in such constructions. (The analysis of RNR constructions is controversial.)
If you don't need to do this, you are generally safe using one article for the whole set. – The Nate Nov 19 '15 at 22:42