This is a more basic explanation on how to build Blatter's generation function.
Following the reasoning and convention in his answer, pretend the we have an unlimited supply of blue balls $($represented by $x)$ and of red balls $($represented by $y)$.
A valid filling for one of the middle slots has one of the forms:
$\qquad(1)$: a (possibly empty) sequence of $xy$'s followed by an $x$.
This result in terms like $x, xyx, xyxyx, \dots$
$\qquad(2)$: a (possibly empty) sequence of $xy$'s preceded by $y$.
This result in terms like $y, yxy, yxyxy, \dots$
$\qquad(3)$: a (possibly empty) sequence of $xy$'s preceded by an $xy$.
This result in terms like $xy, xyxy, xyxyxy, \dots$
$\qquad(4)$: a (possibly empty) sequence of $xy$'s followed by $x$ and preceded by $y$.
This result in terms like $yx, yxyx, yxyxyx, \dots$
These $4$ cases cover all possibilities.
When building a generating function, terms representing a required choice $\big($like choosing what to fill a blank $\_$ with, or following $\text{SEQ}(xy)$ with an $x$ in case $(1)\big)$ are multiplied, while term representing mutually exclusive possibilities are added.
With this mind, for any symbol $z$ a (possibly empty) sequence of $z$'s is given (in terms of formal power series/generating functions) by
$$1+z+z^2+z^3+\dots = \frac1{1-z}.\tag{$**$}$$
Hence, the corresponding term for each possibility above is
\begin{array}{c|c}
\text{Case}&\text{Term}\\
\hline
1&\frac{x}{1-xy}\\\hline
2&\frac{y}{1-xy}\\\hline
3&\frac{xy}{1-xy}\\\hline
4&\frac{yx}{1-xy}\\
\end{array}
Of course the terms for $(3)$ and $(4)$ are equal, but I wrote their numerators in different orders to highlight that they represent different objects: $xy*\text{SEQ}(xy)$ for $(3)$ and $y*\text{SEQ}(xy)*x$ for $(4)$.
It thus follows that the general term for a middle slot
$$\frac{x}{1-xy}+\frac{y}{1-xy}+\frac{xy}{1-xy}+\frac{yx}{1-xy}=\frac{x+y+2xy}{1-xy}, \tag{$\triangle$}$$
and since we must fill $4$ of those slots our generating function will feature $(\triangle)$ to the fourth power.
Now, the endpoint slots also admit one possibility that is unaccounted for, namely that it is empty $($represented by $x^0y^0=1)$.
Like we said before, one way of doing this is simply adding $1$ to $(\triangle)$:
$$1+\frac{x+y+2xy}{1-xy}=\frac{1+x+y+xy}{1-xy}=\frac{(1+x)(1+y)}{1-xy}, \tag{$\square$}$$
Another possibility would have been to consider a modified version of case $(3)$ that accounts for the empty possibility:
$\qquad(3')$: a (possibly empty) sequence of $xy$'s.
This result in terms like $1, xy, xyxy, xyxyxy, \dots$
You see, the requirement in $(3)$ for there to be a preceding $xy$ was included specifically to prevent an empty result, so removing it adds the term we were missing.
Like we calculated in $(**)$, the term corresponding to case $(3')$ is hence $\frac1{1-xy}$.
Cases $(1)$, $(2)$ and $(4)$ still apply, so our final term for an endpoint slot is
$$\frac{x}{1-xy}+\frac{y}{1-xy}+\frac{1}{1-xy}+\frac{yx}{1-xy}=\frac{1+x+y+xy}{1-xy}=\frac{(1+x)(1+y)}{1-xy},$$
yielding the same answer as before, of course.
Since we must fill $2$ endpoint slots, this will be squared in our final generating function.
This covers all slots we had to fill, and hence our generating function is
$$p(x,y)=\frac{\big((1+x)(1+y)\big)^2(x+y+2xy)^4}{(1-xy)^6}$$
Now we turn back to the start.
We don't actually have an unlimited supply of blue or red balls -- we are only interested in the case of exactly $5$ blue balls and $5$ red bals.
It suffices hence to extract the coefficient of $x^5y^5$ in the power series of $p$ about $(0,0)$.