Let $O'(X,Y)$ be the centre of $E_2$.
Let $P(a\cos\theta,b\sin\theta)$ be the tangent point of $E_1,E_2$. Also, let $l$ be the common tangent at $P$. Then, note that $E_1,E_2$ are symmetric about $l$: $\frac{\cos\theta}{a}x+\frac{\sin\theta}{b}y=1$. We have
$$\frac YX=\frac{a\sin\theta}{b\cos\theta}$$
$$\frac{\cos\theta}{a}\cdot\frac{X}{2}+\frac{\sin\theta}{b}\cdot\frac Y2=1.$$
Solving these gives
$$X=\frac{2ab^2\cos\theta}{a^2\sin^2\theta+b^2\cos^2\theta},\quad Y=\frac{2a^2b\sin\theta}{a^2\sin^2\theta+b^2\cos^2\theta}$$
Here, let $\tan\varphi=\frac YX=\frac ab\tan\theta$. Then,
$$\begin{align}r^2&=\frac{4a^2b^2}{a^2\sin^2\theta+b^2\cos^2\theta}\\\\&=\frac{4a^2b^2(1+\tan^2\theta)}{a^2\tan^2\theta+b^2}\\\\&=\frac{4a^2b^2(1+(\frac ba\tan\varphi)^2)}{a^2(\frac ba\tan\varphi)^2+b^2}\\\\&=4(a^2\cos^2\varphi+b^2\sin^2\varphi)\end{align}$$
Hence, the answer is
$$\color{red}{r=2\sqrt{a^2\cos^2\varphi+b^2\sin^2\varphi}}$$
where $(X,Y)$ is the centre of $E_2$ and $\tan\varphi=\frac YX$.