The following proof is a bit heavy-handed; I'm sure you it can be simplified. Assume $a_1=1, a_n=0$ as suggested above and write:

Write $$F(x,y) = \sum_{i=1}^n a_i(x_i^2-y_i^2)$$, $$G(x,y)=F(x,y)^2+\langle x,y\rangle^2.$$
Let $(x,y)\in S^{n-1}\times S^{n-1}$ be a point where $G$ is maximized, where we may assume that for each $i$ at least one of $x_i,y_i$ is non-zero. It is clear that $-\sum_i y_i^2 \leq F(x,y) \leq \sum_i x_i^2$ so we may also assume $\langle x,y\rangle \neq 0$.

By the method of Lagrange multipliers there exist $\xi,\eta$ such that for all $i$
$$ 4a_i x_i F+2\langle x,y\rangle y_i=2\xi x_i$$ and
$$ -4a_i y_i F+2\langle x,y\rangle x_i=2\eta y_i.$$

Multiplying the first equation by $x_i$, the second by $y_i$, adding the two and summing over $i$ gives
$ 4G = 2(\xi+\eta)$. Multiplying the second equation by $y_i$, the first by $x_i$ and adding gives $$ \langle x,y\rangle (y_i^2+x_i^2) = (\xi+\eta)x_i y_i = 2G\cdot x_i y_i. $$ By assumption one of $x_i,y_i$ is non-zero. Dividing by the square of that number we see that the quadratic $$\langle x,y\rangle t^2 - 2G t + \langle x,y\rangle = 0$$ has a real root. Evaluating the discriminant it follows that $$ G^2 \leq \langle x,y\rangle^2 \leq 1.$$