I assume your problem is with the parameter $n$ of $G$ in $G(F(n), n)$. In the transfinite recursion theorem, the step function $G_2$ takes only the previous value $F_z(\alpha)$ and not $\alpha$ itself. The trick is to use the recursion theorem to produce an operation that returns not just the final answer, but also the counter $\alpha$. That is, we define $F'(n)$ such that
F'(0) &= (a, 0)\\
F'(n+1) &= (G(\pi_1(F'(n)),\pi_2(F'(n))),\pi_2(F'(n))+1)
where $\pi_i(x_1,x_2)=x_i$ is the projection function. Then $\pi_2(F'(n))=n$ for all $n$ and the right-hand side of the second equation is a function of only $F'(n)$, not $n$. In the end we can define $F(n)=\pi_1(F'(n))$.