Perhaps added since this question was answered, Wikipedia has good information on this problem. There is an interesting geometric construction which contrasts with the algebraic solutions offered here: Rytz's construction.
(I have been told to add information to the answer rather than just posting links. Unfortunately as my rep is less than 50 I can't make comments yet)
The setting in which I found Rytz's construction useful was in drawing the elevation of a circle in a plan oblique projection. In this case, as in the other conjugate tangent problems that arise in parallel projection, the ellipse is tangent to the midpoints of the edges of a parallelogram. This is a slightly more constrained and regular situation than the diagram referenced in the original question, though a tangent parallelogram could easily be constructed around the ellipse shown in that image.
Rytz's construction is apparently the last refinement of a long series of solutions to this problem, starting with Pappus. It relies on the fact that conjugate diameters are affine images of perpendicular diameters of a circle. In particular, the perpendiculars from the foci to any tangent intersect the tangent on the auxiliary circle, the circle centered at the centre of the ellipse with the major axis as diameter. As I understand it Rytz's construction is a carefully minimized (in terms of number of steps) derivative of the earlier techniques, intended for practical use in drafting, etc.
Let $c$ be the distance between the center of the ellipse and either focus, and $a$ be the length of the semi-major axis. By definition of eccentricity: $e=c/a$, that is: $a=c/e$. In our case we know that $e=1/2$, so that $a=2c$.
If $A$ is any point on the ellipse, $F$ is the focus nearer to the directrix and $AH$ is the distance from $P$ to the directrix, then we have: $AF/AH=e={1\over2}$. Since the directrix is perpendicular to the $x$-axis, then both foci and the center lie on the $x$-axis.
We must consider two cases, depending on whether $(0,0)$ is the focus farther from the directrix or not. The second case was not considered in your solution.
1) $(0,0)$ is the focus farther from the directrix. The center $C$ of the ellipse must then have positive abscissa: $C=(c,0)$ and the other focus is $F=(2c,0)$. If $A$ is endpoint of major axis nearer to the directrix, then $CA=a=2c$ so that $A=(3c,0)$. The equality $AH=2AF$ gives then $4-3c=2c$, whence $c=4/5$ and $a=8/5$.
2) $F=(0,0)$ is the focus nearer to the directrix. Then $C=(-c,0)$ and $A=(c,0)$. The equality $AH=2AF$ gives then $4-c=2c$, whence $c=4/3$ and $a=8/3$.
Best Answer
As the center is the midpoint of the foci, so the center $O(0,0)$
As the foci lie on the major axis , so the equation of the major axis $y=0\implies$ the equation of the minor axis $x=0$
Now, if the length of the major, minor axes be $2a,2b$ respectively with eccentricity $=e$
So, the equation of the ellipse is $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$
Any point $P$ on the ellipse can be $P(a\cos\theta,b\sin\theta)$
So, the distance between $(a\cos\theta,b\sin\theta), (ae,0)$ is
$\sqrt{(ae-a\cos\theta)^2+(b\sin\theta-0)^2}$ $=\sqrt{a^2e^2+a^2\cos^2\theta-2a^2e\cos\theta+a^2(1-e^2)(1-\cos^2\theta)}$ $=a(1-e\cos\theta)$ as $0\le e<1,-1\le \cos\theta\le 1$ and $b^2=a^2(1-e^2)$
Similarly, the distance between $(a\cos\theta,b\sin\theta), (-ae,0)$ is $=a(1+e\cos\theta)$