Yep, the author knew the answer beforehand, I would say much longer before.
Because this is just an instance of the Babylonian method of computing square roots, later discovered to be a particular case of Newton's iterative method for the resolution of nonlinear equations.
So with closed eyes, this sequence converges to $\sqrt2$. You can easily verify it be assuming convergence, so that $a_{n-1}$ and $a_n$ become indiscernible, and
$$a=\frac{a+\dfrac2a}{2}$$ or $$a^2=2.$$ As the initial value is $1$, all terms are positive and convergence is to the positive root (if there is convergence, though).
There is a simple way to explain that method, also known as Heron's formula.
Let $s$ be the number of which you want to extract the root, and let $a$ be an approximation by default. Then $$a<\sqrt s\implies a':=\frac sa>\sqrt s$$ so that $\dfrac sa$ is another approximation, by excess. Now if we take the arithmetic mean, we get a new approximation which is closer than the worse of the two,
$$a''=\frac{a+a'}2=\frac{a+\dfrac sa}{2}.$$
As can be shown, when you are close to the root, the sequence converges extremely rapidly.
For example,
$$a=\color{green}{1.41}\implies a'=\color{green}{1.41}84397163121\cdots\implies a''=\color{green}{1.41421}9858156\cdots$$ while the true value is
$$\sqrt2=1.4142135623731\cdots$$
The next iteration gives $11$ exact digits.
A note on convergence, for the skepticals (the method has been in use for at least two millenia).
Let $$x_n:=\frac{a_n}{\sqrt s}.$$
We have
$$\frac{x_{n+1}-1}{x_{n+1}+1}=\frac{x_n+\dfrac1{x_n}-2}{x_n+\dfrac1{x_n}+2}=\frac{(x_n-1)^2}{(x_n+1)^2}$$
and by induction
$$\frac{x_n-1}{x_n+1}=\left(\frac{x_0-1}{x_0+1}\right)^{2^n}.$$
This is an exact formula for the $n^{th}$ iterate, which proves convergence from any $x_0$ such that
$$\left|\frac{x_0-1}{x_0+1}\right|<1.$$
This holds for all positive $x_0$.
In passing, this also proves quadratic convergence, i.e. the relative error is squared on every iteration.