$\underline{\text{Preliminary Results}}$
Convergent polynomials of infinite degree have uniform continuity, which implies that the sum of the derivatives is equal to the derivative of the sum.
In this section, it is assumed that $~|x| < 1.$
Also, the notation $~[f(x)]', ~[f(x)]'', ~[f(x)]'''~$ is used to represent the first, second, and third derivatives, respectively.
So, start with the formula
$$\sum_{i=0}^\infty ~x^i = \frac{1}{1 - x}. \tag1 $$
Then,
$$\sum_{i=0}^\infty i~x^i = x ~\sum_{i=0}^\infty i~x^{(i-1)}
= x ~\left[ ~~\sum_{i=0}^\infty ~x^i ~~\right]'$$
$$= x ~\left[ ~\frac{1}{1 - x} ~\right]' =
\frac{x}{(1-x)^2}. \tag2 $$
Then, by similar analysis, extending the answer of
Claude Leibovici to
this question, you have that
$$\sum_{i=0}^\infty i^2 x^i = \frac{2x^2}{(1-x)^3} + \frac{x}{(1 - x)^2}. \tag3 $$
Then, using the exact same method
$$\sum_{i=0}^\infty i^3 x^i =
\sum_{i=0}^\infty i(i-1)(i-2)x^i + \sum_{i=0}^\infty 3i^2x^i
- \sum_{i=0}^\infty 2ix^i$$
$$=
x^3 \sum_{i=0}^\infty i(i-1)(i-2)x^{i-3} + \sum_{i=0}^\infty 3i^2x^i - \sum_{i=0}^\infty 2ix^i$$
$$=
x^3 ~\left[ \sum_{i=0}^\infty x^i ~\right]''' + \sum_{i=0}^\infty 3i^2x^i - \sum_{i=0}^\infty 2ix^i$$
$$=
x^3 ~\left[ ~\frac{1}{1 - x} ~\right]''' + \sum_{i=0}^\infty 3i^2x^i - \sum_{i=0}^\infty 2ix^i$$
$$=
\frac{6x^3}{(1 - x)^4} + \frac{6x^2}{(1-x)^3} + \frac{3x}{(1 - x)^2} - \frac{2x}{(1-x)^2}$$
$$=
\frac{6x^3}{(1 - x)^4} + \frac{6x^2}{(1-x)^3} + \frac{x}{(1 - x)^2}. \tag4 $$
The formulas in (2), (3), and (4), above will be used in the analysis below.
For $~k \in \{3,4,5,\cdots,\},~$ let $~E(k)~$ denote the event that it takes exactly $~k~$ rolls to get three 4's.
Let $~f(k)~$ denote the probability of the event $~E(k)~$ occurring.
Let $~g(k)~$ denote the expected number of 2's and 3's that will be rolled before dice roll number $~k,~$ under the assumption that event $~E(k)~$ has occurred.
Then the desired computation is
$$\sum_{k=3}^\infty \left[ ~f(k) \times g(k) ~\right]. \tag5 $$
In order for event $~E(k)~$ to occur, two things must happen.
There must be exactly two 4's rolled in the first $~(k-1)~$ die rolls.
The probability of this happening is
$\displaystyle \frac{\binom{k-1}{2}5^{(k-3)}}{6^{(k-1)}}.$
The $~k$-th roll must be a 4.
The probability of this happening is $~\dfrac{1}{6}.$
Therefore,
$$f(k) = [ ~(k-1) ~(k-2) ~] \times \left[ ~\frac{5}{6} ~\right]^{(k-3)} \times \frac{1}{2 \times 6^3}. \tag6 $$
Now, assume that event $~E(k)~$ has occurred. For $~k = 3, ~g(k) = 0.$ So, assume that $~k > 3.~$ Since three of the rolls were equal to 4, there were exactly $~(k-3)~$ rolls that were not equal to $~4.~$ Each of those rolls had a $~(2/5)~$ probability of being a 2 or a 3.
Therefore,
$$g(k) = \frac{2}{5} \times (k-3), \tag7 $$
with the expression in (7) above also holding for $~k = 3.$
So, the expression to be simplified is
$$\sum_{k=3}^\infty \left[ ~f(k) \times g(k) ~\right]$$
$$= \sum_{k=3}^\infty \left\{ ~[ ~(k-1) ~(k-2) ~] \times \left[ ~\frac{5}{6} ~\right]^{(k-3)} \times \frac{1}{2 \times 6^3} \\
\times \left[ ~\frac{2}{5} \times (k-3) ~\right] ~\right\}. \tag 8
$$
Set $~A = \dfrac{1}{5 \times 6^3}, ~x = \dfrac{5}{6}.~$
Then, the expression in (8) above may be equivalently expressed as
$$A \times \sum_{k=3}^\infty [ ~(k-1) ~(k-2) ~(k-3) ~] \times x^{(k-3)}. \tag9$$
Re-index the expression in (9) above, by setting $~j = k-3.$
Then, the expression in (9) above may be equivalently expressed as
$$A \times \sum_{j=0}^\infty [ ~(j+2) ~(j+1) ~(j) ~] \times x^j$$
$$= A \times \sum_{j=0}^\infty [ ~j^3 + 3j^2 + 2j ~] \times x^j. \tag{10}$$
It only remains to plug the formulas given by (2), (3), and (4) into the expression in (10) above.
With $~A = \dfrac{1}{5 \times 6^3}, ~x = \dfrac{5}{6}, ~$ you end up with
$$A \times ~~\text{the following computation}:$$
$$\left\{ ~\frac{6x^3}{(1 - x)^4} + \frac{6x^2}{(1-x)^3} + \frac{x}{(1 - x)^2} ~\right\} \\
+ \left\{ ~\frac{6x^2}{(1-x)^3} + \frac{3x}{(1 - x)^2} ~\right\} \\
+ \left\{ ~\frac{2x}{(1-x)^2} ~\right\}
$$
This equals
$$A \times \left\{ ~\frac{6x^3}{(1 - x)^4} + \frac{12x^2}{(1-x)^3} + \frac{6x}{(1 - x)^2} ~\right\}$$
$$= A \times \left[ ~\frac{6x}{(1-x)^2} ~\right] \times \left[ ~\left( ~\frac{x}{1-x} ~\right) + 1 ~\right]^2$$
$$= A \times \left[ ~\frac{6x}{(1-x)^2} ~\right] \times \left[ ~\frac{1}{1-x} ~\right]^2$$
$$= \frac{1}{5 \times 6^3} \times \left[ ~\frac{5}{1/36} ~\right] \times \left[ ~\frac{1}{1/36} ~\right]$$
$$= 6.$$