If $2AB = (BA)^2+I_n$ then $1$ is an eigenvalue for $AB$
The condition implies that $BA$ commutes with $AB$ and hence they are simultaneously triangularisable over $\mathbb C$.
Let $AB$ and $BA$ be simultaneously triangularised. Since $AB$ and $BA$ in general have identical spectra, if $\lambda_1,\ldots,\lambda_n$ are the eigenvalues of $BA$ along its diagonal, then the entries along the diagonal of $AB$ are $\lambda_{\sigma(1)},\ldots,\lambda_{\sigma(n)}$ for some permutation $\sigma$. So, the given condition implies that $f(\lambda_i)=\lambda_{\sigma(i)}$ where $f:z\mapsto (z^2+1)/2$.
In other words, $f$ is a bijection among the eigenvalues of $BA$. As $f$ maps real numbers to real numbers, it must also be a bijection among the real eigenvalues of $BA$.
Since $BA$ is a real matrix of odd dimension, real eigenvalues do exist. Now, as $f(x)\ge x$ on $\mathbb R$, $f$ must map the largest real eigenvalue of $BA$ to itself. Solving $f(x)=x$, we see that this eigenvalue is $1$.
Edit. As the OP points out in his comment, actually we only need to consider the largest real eigenvalue. Let $(\lambda,x)$ be an eigenpair of $BA$, where $\lambda$ is the largest real eigenvalue of $BA$. Then $(\frac{\lambda^2+1}2,x)$ is an eigenpair of $AB$. However, since $AB$ and $BA$ have identical spectra and $\frac{\lambda^2+1}2\ge \lambda$, we must have $\frac{\lambda^2+1}2=\lambda$ and hence $\lambda=1$.