To simplify, we can solve the constraint $\alpha \log a + (1-\alpha)\log (1-a)$ for $\alpha$: $$\alpha = \frac{L - \log(1-a)}{\log(a) - \log(1-a)}$$\begin{equation} \tag{3} \alpha = \frac{L - \log(1-a)}{\log(a) - \log(1-a)} \end{equation} and now rewrite our minimization as: minimize $$f(a) = \frac{(L - \log(1-a))(1-a)^2 + (\log(a)-L)a^2}{\log(a)-\log(1-a)}$$ over $$a \in (0, \min(e^L, 1-e^L)), \quad n\alpha \in \mathbb{N}$$
Edit: Here are some pictures for why the smallest value of $a$ below does always corresponds to the smallest value of $\alpha$. I think it's helpful to visualize first. Here is $\alpha$ as a function of $a$ for $L = \log(.99)$, $L = \log(.51)$, $L = \log(1/2)$, and $L = \log(.49)$.
$L = \log(.99)$ $L = \log(.51)$ $L = \log(.5)$ $L = \log(.49)$
If $L \leq \log(1/2)$ then $\alpha$ as a function of $a$ has no critical points and is increasing (similar reasoning as with $f(a)$). Therefore taking the smallest possible $\alpha$ gives you the smallest possible $a$.
If $L > \log(1/2)$ then for $a \in [0, 1-e^{L}] = [0, min(e^L, 1-e^L)]$, $\alpha$ has a single critical point, a maximum, and is zero at the endpoints. Therefore, we can (mistakenly) choose $\alpha = 1/1000$ and then take $a$ to be large. But, you can visualize all allowable values of $a$ by drawing a discrete collection of horizontal lines on this picture (here's $L = log(.51), n=10$): The possible choices of $a$ in our discrete set are given by intersections of the red lines with our blue curve, by the nature of the function each red line has two intersections with the blue curve. The lowest red line has both the smallest and largest value of $a$. This picture also illustrates how to find the counterexample to your stackexchange question.