I started this answer, typed a good part of it, but then a compact solution having in essence the same counting strategy already appeared.
The only difference is that below we go explicitly through the partitions of ten, and count for each one the corresponding cases. Details are given at all places, two ways to check are also inserted.
The reader may benefit from the two points of view of the same idea, and the
variations.
@OP: Please consider already accepting the other answer of bof!
I will use $R,G,B$ for the given colors.
Let the places in the line be numbered from $1$ to $15$. We want to count the functions $X:\{1,2,\dots,15\}\to\{R,G,B\}$ with $X(k)\ne X(k+1)$ when $k$ runs from $1$ to $14$. Below $X$ is such a function.
There are three possibilities for $X(1)$.
By symmetry, we may and do assume $X(1)=R$, count such functions first, then finally multiply by $3$. There are two possibilities now for $X(2)$. We may and do assume furthermore $X(2)=G$, count such functions
Consider the other four places where $X=1$, and remove now all $R$ nodes from the connected graph
o---o---o---o---o---o---o---o---o---o---o---o---o---o---o
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Then there remain
- either four connected components, this is the case when $X(15)=R$,
- or else five connected components, the case $X(15)\ne R$.
We take the number of elements in those components, and obtain a partition of $10$, the remained $5G$ and $5B$ nodes. We list all possible partitions of $10$ in four or five pieces, after we order each such partition.
For instance, $10$ can be partitioned as $\pi=(1,5,1,3)$. The ordered version is $\Pi=(5,3,1,1)$. There are more partitions having $\Pi$ as ordered version,
and we denote by $n(\Pi)$ this number of unordered versions leading to $\Pi$.
How many versions are there for a given $\Pi$? To have a formula from case to case we proceed as follows. Collect the elements in $\Pi$, seen as a set, In the sample $\Pi$, the elements are $5,3,1$. Then we count how often they appear. In the sample respectively $1,1,2$ times. Then the number of version is the corresponding multinomial coefficient, in the sample $\binom 4{112}$.
The length of a partition $\Pi$ is denoted below by $l(\Pi)$, so for our sample above $l(\Pi)=4$.
It remains to count how many possibilities there are to fill a partition $\Pi$ in the four or five intervals in their nodes with the $5G$ and $5B$ balls,
let us denote this number by $f(\pi)$. Of course, $f$ is the same or $\pi$, and for the ordered version $\Pi$.
How to compute $f$ for a given partition $\Pi=(\Pi_1,\Pi_2,\Pi_3,\dots)$?
First of all we note that if the color ($G$ or $B$) of the first ball in an interval of length $\Pi_k$ is fixed, then the interval is colored in a unique manner, we are constrained to alternate the two colors. So there are at a rough view $2\cdot2\cdot2\cdot\dots\cdot 2=2^{l(\Pi)}$ filling possibilities.
However, there is the restriction that we use as many $G$ balls as $B$ balls. The intervals of even length are already balanced, they are not introducing any constraint. But the odd length intervals do contribute. Since we are partitioning ten, an even number, there are either two or four odd entries among $\Pi_1,\Pi_2,\Pi_3,\dots$ - and in case of two odd entries the two odd length interval must start (and end) with different colors. So there are $2^{l(P)-1}$ possibilities, taking the contraint in account. What about four odd entries, as in the case $5,3,1,1$. Exactly two of the four intervals start with $G$, exactly two with $B$. We consider the positions of the two $G$-starting blocks, two positions among four, so there are $\binom 42=6$ possibilities. The formula for the filling $f(\Pi)$ is in this case $2^{l(\Pi)-4}\cdot\binom 42$. With this structure in fact, the number of fillings in case of a $\Pi$ with $0$, respectively $2$ odd pieces is
$2^{l(\Pi)-0}\cdot\binom00=2^{l(\Pi)}$, respectively $2^{l(\Pi)-2}\cdot\binom21=2^{l(\Pi)-1}$.
The combinatorial data can be collected so far in a table:
$$
\begin{array}{|l|c|l|r|}
\hline
\Pi & l(\Pi) & n(\Pi) & f(\Pi) & n(\Pi)\cdot f(\Pi)\\\hline
(7, 1, 1, 1) & 4 & \binom4{ 1,3 } = 4 & 2^{4-4}\cdot \binom 42 = 6 & 24\\\hline
(6, 2, 1, 1) & 4 & \binom4{ 1,1,2 } = 12 & 2^{4-2}\cdot \binom 21 = 8 & 96\\\hline
(5, 3, 1, 1) & 4 & \binom4{ 1,1,2 } = 12 & 2^{4-4}\cdot \binom 42 = 6 & 72\\\hline
(5, 2, 2, 1) & 4 & \binom4{ 1,2,1 } = 12 & 2^{4-2}\cdot \binom 21 = 8 & 96\\\hline
(4, 4, 1, 1) & 4 & \binom4{ 2,2 } = 6 & 2^{4-2}\cdot \binom 21 = 8 & 48 \\\hline
(4, 3, 2, 1) & 4 & \binom4{ 1,1,1,1 } = 24 & 2^{4-2}\cdot \binom 21 = 8 & 192\\\hline
(4, 2, 2, 2) & 4 & \binom4{ 1,3 } = 4 & 2^{4-0}\cdot \binom 00 = 16 & 64\\\hline
(3, 3, 3, 1) & 4 & \binom4{ 3,1 } = 4 & 2^{4-4}\cdot \binom 42 = 6 & 24\\\hline
(3, 3, 2, 2) & 4 & \binom4{ 2,2 } = 6 & 2^{4-2}\cdot \binom 21 = 8 & 48 \\\hline
%
(6, 1, 1, 1, 1) & 5 & \binom5{ 1,4 } = 5 & 2^{5-4}\cdot \binom 42 = 12 & 60\\\hline
(5, 2, 1, 1, 1) & 5 & \binom5{ 1,1,3 } = 20 & 2^{5-4}\cdot \binom 42 = 12 & 240\\\hline
(4, 3, 1, 1, 1) & 5 & \binom5{ 1,1,3 } = 20 & 2^{5-4}\cdot \binom 42 = 12 & 240\\\hline
(4, 2, 2, 1, 1) & 5 & \binom5{ 1,2,2 } = 30 & 2^{5-2}\cdot \binom 21 = 16 & 480\\\hline
(3, 3, 2, 1, 1) & 5 & \binom5{ 2,1,2 } = 30 & 2^{5-4}\cdot \binom 42 = 12 & 360\\\hline
(3, 2, 2, 2, 1) & 5 & \binom5{ 1,3,1 } = 20 & 2^{5-2}\cdot \binom 21 = 16 & 320\\\hline
(2, 2, 2, 2, 2) & 5 & \binom5{ 5 } = 1 & 2^{5-0}\cdot \binom 00 = 32 & 32\\\hline
\end{array}
$$
The wanted number is thus:
$$
\begin{aligned}
\sum_{\pi}f(\pi)&=
\sum_{\Pi\text{ ordered}}n(\Pi)f(\Pi)
\\
&=
24 + 96 + 72 + 96 + 48 + 192 + 64 + 24 + 48
\\
&\qquad\qquad + 60 + 240 + 240 + 480 + 360 + 320 + 32
\\
&=664 + 1732 = \bbox[yellow]{\ 2396\ }\ .
\end{aligned}
$$
Recall that this is the count for the case $X(1)=R$. The final count is
$$
3\cdot 2396=\bbox[yellow]{\ 7188\ }\ .
$$
Computer check:
Here is a short piece of code that covers "all cases" and checks the $5R+5G+5B$ condition. Well, all cases are $3^{15}=14348907$, but we may use the information from the condition, and have thus after each known ball step exactly two chances to generate, the two other colors. Instead of using $R,G,B$ is useful to count using the (addition group of the) field with three elements $\Bbb F_3=\Bbb Z/3$. Then if one ball is $b$, the next ball is either $b+1$ or $b+2$, thus obtained from $b$ by a non-zero increment, the code uses inc for such an increment at each position. And here is the code, in fact we have a straightforward programming problem, but a rather complicated combinatorial one:
F = GF(3)
R = [F(1), F(2)]
increments_range = 14*[R]
good_cases = 0 # so far
for b in F: # b is the color of the first ball
for increments in cartesian_product(increments_range):
balls = [b]
for inc in increments:
balls.append(balls[-1] + inc)
if balls.count(F(0)) == 5 and balls.count(F(1)) == 5:
good_cases += 1
print(good_cases)
That's all, we get our number, 7188.
There is an alternative approach using generating series.
For instance as in
Counting words with Laguerre series, Jair Taylor, §2, Laguerre polynomials and Laguerre series
where polynomials $l_k(t)$ are introduced. They are defined as the part in $x^k$ in the (formal) Taylor expansion of the generating series
$$
\exp\frac {tx}{1+x}\ .
$$
Then we want to compute, in the notations from loc. cit. the polynomial $l_5(t)$, then consider $l_5(t)^3$ as a polynomial, and apply on it the linear functional $\Phi$ defined by $\Phi(t^n):=n!$.
The polynomial $l_5(t)$ is easily computed with code
sage: var('t,x');
sage: taylor( exp(t*x/(1+x)), x, 0, 5).coefficient(x^5)
1/120*t^5 - 1/6*t^4 + t^3 - 2*t^2 + t
but also humanly we have a chance. Below, we denote by $[x^5]g$ the
part in $x^5$ in a series $g$.
$$
\begin{aligned}
[x^5]\exp\frac {tx}{1+x}
&=
[x^5]\frac 1{0!} +
[x^5]\frac 1{1!} \frac {tx}{1+x} +
[x^5]\frac 1{2!} \frac {(tx)^2}{(1+x)^2} +
[x^5]\frac 1{3!} \frac {(tx)^3}{(1+x)^3} +
\\
&\qquad\qquad\qquad
[x^5]\frac 1{4!} \frac {(tx)^4}{(1+x)^4} +
[x^5]\frac 1{5!} \frac {(tx)^5}{(1+x)^5}
\\
&=
\frac t{1!}[x^5](x-x^2+x^3-x^4+x^5-\dots)
\\
&\qquad +
\frac {t^2}{2!}[x^5]\frac 11(1\cdot x^2-2\cdot x^3+3\cdot x^4-4\cdot x^5+5\cdot x^6-\dots)
\\
&\qquad +
\frac {t^3}{3!}[x^5]\frac1{1\cdot 2}(1\cdot 2x^3-2\cdot 3x^4
+3\cdot 4x^5-4\cdot 5x^6+\dots)
\\
&\qquad +
\frac {t^4}{4!}[x^5]\frac1{1\cdot 2\cdot 3}(1\cdot 2\cdot 3x^4-2\cdot 3\cdot 4x^5+3\cdot 4\cdot 5x^6-\dots)
\\
&\qquad +
\frac {t^5}{4!}[x^5]\frac1{1\cdot 2\cdot 3\cdot 4}(1\cdot 2\cdot 3\cdot 4x^5-2\cdot 3\cdot 4\cdot 5x^6+\dots)
\\
&=t-2t^2+t^3-\frac 16t^4+\frac 1{120}t^5\ .
\end{aligned}
$$
But now, we have humanly a computational problem of $l_5(t)^3$, which is
annoying, it hides more work than the combinatorial solution above.
For this reason, i consider this solution as only a check, assisted by sage.
Yes, the whole checking code can be written in a simpler manner, since $\Phi$ can be implemented by $\Phi(p) = \int_{(0,\infty)}\exp(-t)\;p(t)\; dt$.
Code, also including the above computation of $l_5$:
var('t,x');
L5 = taylor( exp(t*x/(1+x)), x, 0, 5).coefficient(x^5)
N = integral(exp(-t) * L5^3, t, 0, oo)
print(f"\\Phi(l_5(t)^3) = {N}\\ .")
And we get:
$$
\Phi(l_5(t)^3) = 7188\ .
$$
(Yes, a brilliant approach, when computers are allowed, but on the other side, brute force plain and lazy counting works too.)