Here is a completely different way to approach this integral, which relies on some elementary complex analysis (Cauchy's theorem). It is based on an approach which I have seen several times employed to compute $\int_0^{\pi/2}\log{(\sin{x})}\,dx$ (particularly, in Ahlfors's book).
The idea is to integrate the principal branch of $f(z) := \log^2{(1 - e^{2iz})} = \log^2{(-2ie^{iz}\sin{z})}$ over the contour below, and then let $R \to \infty$ and $\epsilon \to 0$.

First of all, $1 - e^{2iz} \leq 0$ only when $z = k\pi + iy$, where $k$ is integral and $y \leq 0$. Thus, in the region of the plane which is obtained by omitting the lines $\{k\pi + iy: y\leq 0\}$ for $k \in \mathbb Z$, the principal branch of $\log{(1-e^{2iz})}$ is defined and analytic. Note that, for each fixed $R$ and $\epsilon$, the contour we wish to integrate over is contained entirely within this region.
By Cauchy's theorem, the integral over the contour vanishes for each fixed $R$. Since $f(x + iR) = \log^2{(1 - e^{2ix}e^{-2R})} \to 0$ uniformly as $R \to \infty$, the integral over the segment $[iR,\pi/2 + iR]$ vanishes in the limit. Similarly, since $1 - e^{2iz} = O(z)$ as $z \to 0$, we have $f(z) = O(\log^2{|z|})$ for small enough $z$, which, since $\epsilon \log^2{\epsilon} \to 0$ with $\epsilon$, means that the the integral over the circular arc from $i\epsilon$ to $\epsilon$ vanishes as $\epsilon \to 0$.
From the vertical sides of the contour, we get the contribution
$$
\begin{align*}
\int_{[\pi/2,\pi/2 + iR]} + \int_{[iR,i\epsilon]} f(z)\,dz & = i\int_0^R f(\pi/2 + iy)\,dy -i\int_\epsilon^R f(iy)\,dy.
\end{align*}
$$
Since $f(iy)$ and $f(\pi/2 + iy)$ are real, this contribution is purely imaginary.
Finally, the contribution from the bottom side of the contour, after letting $\epsilon \to 0$, is
$$
\begin{align*}
\int_0^{\pi/2} f(x)\,dx = \int_0^{\pi/2} \log^2{(-2ie^{ix}\sin{x})}\,dx,
\end{align*}
$$
and we know from the preceding remarks that the real part of this integral must vanish. For $x$ between $0$ and $\pi/2$, the quantity $2\sin{x}$ is positive. Writing $-ie^{ix} = e^{i(x - \pi/2)}$, we see that $x - \pi/2$ is the unique value of $\arg{(-2ie^{ix}\sin{x})}$ which lies in $(-\pi,\pi)$. Since we have chosen the principal branch of $\log{z}$, it follows from these considerations that $\log{(-2ie^{ix}\sin{x})} = \log{(2\sin{x})} + i(x-\pi/2)$, and therefore that
$$
\begin{align*}
\text{Re}{f(x)} &= \log^2{(2\sin{x})} - (x-\pi/2)^2 \\
&= \log^2{(\sin{x})} + 2\log{2}\log{(\sin{x})} + \log^2{2} - (x - \pi/2)^2.
\end{align*}
$$
By setting $\int_0^{\pi/2} \text{Re}f(x)\,dx = 0$ we get
$$
\begin{align*}
\int_0^{\pi/2} \log^2{(\sin{x})}\,dx &= \int_0^{\pi/2}(x-\pi/2)^2\,dx - 2\log{2}\int_0^{\pi/2} \log{(\sin{x})}\,dx -\frac{\pi}{2}\log^2{2} \\
& = \frac{1}{3}\left(\frac{\pi}{2}\right)^3 + \frac{\pi}{2} \log^2{2}
\end{align*}
$$
as expected
By similar methods, one can compute a variety of integrals of this form with little difficulty. Here are some examples I have computed for fun. All are proved by the same method, with the same contour, but different functions $f$.
- Take $f(z) = \log{(1 + e^{2iz})} = \log{(2e^{iz}\cos{z})}$ and compare imaginary parts to get
$$
\int_0^\infty \log{(\coth{y})}\,dy = \frac{1}{2}\left(\frac{\pi}{2}\right)^2.
$$
- Related to this question of yours (which incidentally led me here), one can show by taking $f(z) = \log^4(1 + e^{2iz})$ and comparing real parts that
$$
\int_0^{\pi/2} x^2\log^2{(2\cos{x})}\,dx = \frac{1}{30}\left(\frac{\pi}{2}\right)^5 + \frac{1}{6}\int_0^{\pi/2} \log^4{(2\cos{x})}\,dx.
$$
Assuming the result of the other question, we then get
$$
\int_0^{\pi/2} \log^4{(2\cos{x})}\,dx = \frac{19}{15}\left(\frac{\pi}{2}\right)^5.
$$
- Also related to the question cited in 2., taking $f(z) = z^2\log^2{(1 + e^{2iz})}$ and comparing real parts gives
$$
\int_0^{\pi/2}x^2\log^2{(2\cos{x})}\,dx = \frac{1}{5}\left(\frac{\pi}{2}\right)^5 + \pi \int_0^\infty y\log^2{(1- e^{-2y})}\,dy.
$$
Once more, assuming the result of the other question, we get
$$
\int_0^\infty y\log^2{(1- e^{-2y})}\,dy = \frac{1}{45}\left(\frac{\pi}{2}\right)^4.
$$
Actually, the integral in 3. has several interesting series expansions, and I would be very interested if someone could compute it without using the result from the question I cited. For one thing, that would give us a different proof of that result (which is why I started investigating it in the first place).