You complain that the solution posits an equation of motion
\begin{align}
x(t) &\sim a\sin\omega t
\tag1
\\
x''(t) & \sim -\omega^2 a\sin\omega t
\tag2
\end{align}
which is the solution to the simple harmonic oscillator $mx'' = -kx$,
not to your anharmonic oscillator $mx'' = -kx^2$. Which is a valid criticism.
However, if you make the reasonable assumption that the motion will be periodic, then Fourier analysis tells us that the solution can be written in the form
\begin{align}
x(t) &= a_1\sin\omega t + a_2 \sin 2\omega t + \cdots
+ b_3 \cos3\omega t + \cdots
\\
x''(t) &= -\omega^2 \left(
a_1\sin\omega t + 2^2 a_2 \sin 2\omega t + \cdots
+ 3^2 b_3 \cos3\omega t + \cdots
\right)
\end{align}
where the ellipsis includes perhaps some cosine terms as well.
Finding all the Fourier coefficients so that the sum in parentheses is the square of the first line is a straightforward, if tedious, problem.
But if you have some experience with Fourier series, you'll know to expect that the low-frequency coefficient is going to dominate, in which case
$$
x(t) \sim a_1\sin\omega t
$$
is wrong, but not grossly wrong.
How you proceed from there depends on your personal taste.
Your text seems to be following a logic like
the equation of motion is
$$
-kx^2 = mx''
$$
substituting (1) on the left and (2) on the right,
$$
-k \left(a\sin\omega t\right)^2 = -\omega^2 a\sin\omega t
$$
solve for $T\propto 1/\omega$
- pretend not to notice that the period $T$ seems to depend on time, and only look at its dependence on the amplitude $a$.
The fourth step makes me uncomfortable, and I think it made you uncomfortable too, since you put it in the title of your question.
Qmechanic suggests the physicist's approach, using dimensional analysis.
The only free parameters in the motion are:
the stiffness of the potential $k$, in $\rm J/m^3$;
the mass of the oscillator $m$ in kilograms;
and the amplitude of the oscillation $a\propto a_1$ in meters.
There's only one way to combine these three physically meaningful parameters to obtain a time in seconds, and it gives $T\propto \sqrt{m/ak}$.