Let $\mathrm{sn}(\theta) = \mathrm{sn}(\theta,\sqrt{m})$,
$\mathrm{cn}(\theta) = \mathrm{cn}(\theta,\sqrt{m})$,
$\mathrm{dn}(\theta) = \mathrm{dn}(\theta,\sqrt{m})$ be the
Jacobi elliptic functions associated with $k = \sqrt{m} = \sqrt{n(2-n)}$. Introduce parametrization:
$$
\theta = \int_{0}^t \frac{dt}{\sqrt{(1-t^2)(1-k^2t^2)}} \rightarrow t = \mathrm{sn}(\theta )
$$
and let $\mathrm{sn}(\theta_0)^2 = \frac{1}{n}$, we can rewrite the integral as:
$$
\Pi(n;\phi|k^2)= \mathrm{sn}(\theta_0)^2 \int_0^{\mathrm{sn}^{-1}(\sin\phi)} \frac{d\theta}{\mathrm{sn}(\theta_0)^2-\mathrm{sn}(\theta)^2}
$$
For given $\epsilon$, introduce $\varphi$, $\psi$ such that
$\sin(\varphi) = \sqrt{\frac{1-\epsilon}{n}} = \mathrm{sn}(\psi)$.
Notice
$$\begin{align}
\mathrm{cn}(\theta_0) &= \sqrt{1 - \mathrm{sn}(\theta_0)^2} = \sqrt{\frac{n-1}{n}}\\
\mathrm{dn}(\theta_0) &= \sqrt{1 - k^2\mathrm{sn}(\theta_0)^2} = \sqrt{n-1}\\
\frac{d}{d\theta} \mathrm{sn}(\theta) &= \mathrm{cn}(\theta)\mathrm{dn}(\theta)\\
\end{align}
$$
We see $\mathrm{cn}(\theta_0) = \mathrm{sn}(\theta_0)\mathrm{dn}(\theta_0)$ and
the expression appear within the definition of $C(n)$ becomes:
$$
\begin{align}
&2(n-1)\Pi\left(n;\varphi|k^2\right) +\log\epsilon\\
=& 2\,\mathrm{cn}(\theta_0)^2 \int_0^{\psi} \frac{d\theta}{\mathrm{sn}(\theta_0)^2-\mathrm{sn}(\theta)^2} + \log(1- \frac{\mathrm{sn}(\psi)^2}{\mathrm{sn}(\theta_0)^2} )\\
=& \int_0^{\psi} \frac{2 d\theta}{\mathrm{sn}(\theta_0)^2-\mathrm{sn}(\theta)^2}
( \mathrm{cn}(\theta_0)^2 - \mathrm{sn}(\theta)\mathrm{cn}(\theta)\mathrm{dn}(\theta) )\\
=& \int_0^{\psi} \frac{2 d\theta}{\mathrm{sn}(\theta_0)^2-\mathrm{sn}(\theta)^2}
( \mathrm{sn}(\theta_0)\mathrm{cn}(\theta_0)\mathrm{dn}(\theta_0) - \mathrm{sn}(\theta)\mathrm{cn}(\theta)\mathrm{dn}(\theta) )
\end{align}
$$
Since the numerator goes to $0$ as $\theta \to \theta_0$, the $\epsilon \to 0$ limit of the definition of $C(n)$ exists and is given by:
$$
C(n) = \int_0^{\theta_0} \frac{2 d\theta}{\mathrm{sn}(\theta_0)^2-\mathrm{sn}(\theta)^2}
( \mathrm{sn}(\theta_0)\mathrm{cn}(\theta_0)\mathrm{dn}(\theta_0) - \mathrm{sn}(\theta)\mathrm{cn}(\theta)\mathrm{dn}(\theta) )
$$
I don't know how to simplify this further but at least this is an alternate approach.
I prefer to have the singular behaviour near $0$ rather than at $\frac{\pi}{2}$, so let's make the substitution $\varphi = \frac{\pi}{2} - \theta$. We obtain
$$K(k) = \int_0^{\frac{\pi}{2}} \frac{d\varphi}{\sqrt{1 - k^2\cos^2\varphi}}.$$
Split the integral at $\frac{\pi}{4}$. The part
$$\int_{\frac{\pi}{4}}^{\frac{\pi}{2}} \frac{d\varphi}{\sqrt{1 - k^2\cos^2\varphi}}$$
remains harmless as $k \to 1$ and tends to
$$\int_{\frac{\pi}{4}}^{\frac{\pi}{2}} \frac{d\varphi}{\sin \varphi}.$$
For the other part, write $1 = \sin^2 \varphi + \cos^2 \varphi$ to obtain $1 - k^2\cos^2\varphi = \sin^2 \varphi + (1-k^2)\cos^2 \varphi$. Let $\varepsilon = \sqrt{1-k^2}$. Then
\begin{align}
\int_0^{\frac{\pi}{4}} \frac{d\varphi}{\sqrt{1 - k^2\cos^2 \varphi}} &= \int_0^{\frac{\pi}{4}} \frac{\cos^2 \varphi + \sin^2 \varphi}{\sqrt{\cos^2 \varphi + \sin^2 \varphi}\cdot \sqrt{\sin^2 \varphi + \varepsilon^2 \cos^2\varphi}}\,d\varphi\\
&= \int_0^{\frac{\pi}{4}} \frac{1 + \tan^2\varphi}{\sqrt{1 + \tan^2 \varphi}\cdot \sqrt{\varepsilon^2 + \tan^2 \varphi}}\,d\varphi \tag{$t = \tan \varphi$}\\
&= \int_0^1 \frac{dt}{\sqrt{1+t^2}\cdot \sqrt{\varepsilon^2 + t^2}}\\
&= \int_0^1 \frac{dt}{\sqrt{\varepsilon^2 + t^2}} - \int_0^1 \Biggl(1 - \frac{1}{\sqrt{1+t^2}}\Biggr) \frac{dt}{\sqrt{\varepsilon^2 + t^2}}.
\end{align}
Since
$$1 - \frac{1}{\sqrt{1+t^2}} = \frac{\sqrt{1+t^2}-1}{\sqrt{1+t^2}} = \frac{t^2}{\sqrt{1+t^2}\cdot (1 + \sqrt{1+t^2})},$$
the last integral remains bounded and tends to
$$\int_0^1 \frac{t \,dt}{1 + t^2 + \sqrt{1+t^2}}$$
as $\varepsilon \to 0$.
And the substitution $t = \varepsilon u$ gives us
\begin{align}
\int_0^1 \frac{dt}{\sqrt{\varepsilon^2 + t^2}} &= \int_0^{\frac{1}{\varepsilon}} \frac{du}{\sqrt{1+u^2}}\\
&= \operatorname{Ar sinh} \frac{1}{\varepsilon}\\
&= \log \biggl(\frac{1}{\varepsilon} + \sqrt{1 + \frac{1}{\varepsilon^2}}\biggr)\\
&= \log \frac{1}{\varepsilon} + \log 2 + \log \frac{1 + \sqrt{1+\varepsilon^2}}{2}.
\end{align}
Thus we have
$$K(k) = \log \frac{1}{\sqrt{1-k^2}} + O(1) = \frac{1}{2}\log \frac{1}{1-k} - \frac{1}{2}\log (1+k) + O(1) = \frac{1}{2}\log \frac{1}{1-k} + O(1).$$
In our specific case, with $k = \sin \bigl(\frac{\pi}{2} - \frac{\delta}{2}\bigr) = \cos \frac{\delta}{2}$, we have $\varepsilon = \sqrt{1-k^2} = \sin \frac{\delta}{2} = \frac{\delta}{2} + O(\delta^3)$, so
$$\log \frac{1}{\varepsilon} = \log \frac{2}{\delta} + O(\delta^2)$$
and overall
$$K\bigl(\cos \tfrac{\delta}{2}\bigr) = \log \frac{1}{\delta} + O(1),$$
where the $O(1)$ term is not only bounded, it in fact converges as $\delta \to 0$. We have the relevant terms:
$$K\bigl(\cos \tfrac{\delta}{2}\bigr) = \log \frac{1}{\delta} + 2\log 2 + \int_0^1 \frac{t\,dt}{1+t^2+\sqrt{1+t^2}} + \int_{\frac{\pi}{4}}^{\frac{\pi}{2}} \frac{d\varphi}{\sin \varphi} + o(1).$$
Best Answer
What do you mean by solving such integral? Such integral is what it is, i.e. a complete elliptic integral of the second kind. Efficient algorithms for the numerical evaluation are given by the relations between $E,K$ and the AGM mean. If you are fine with algorithms with a linear (instead of a quadratic, or even faster) convergence speed, you may simply exploit the identities
$$\sqrt{1-x}=\sum_{n\geq 0}\frac{1}{4^n}\binom{2n}{n}\frac{x^n}{1-2n} \tag{1} $$ $$ \int_{0}^{\pi/2}\left(\cos\theta\right)^{2n}\,d\theta = \frac{\pi}{2}\cdot\frac{1}{4^n}\binom{2n}{n}\tag{2}$$ leading to
$$ \int_{0}^{\pi/2}\sqrt{1-a^2\cos^2\theta}\,d\theta = \frac{\pi}{2}\sum_{n\geq 0}\left[\frac{1}{4^n}\binom{2n}{n}\right]^2\frac{a^{2n}}{1-2n} \tag{3} $$ where $$ \left[\frac{1}{4^n}\binom{2n}{n}\right]^2 \approx \frac{1}{\pi\left(n+\frac{1}{4}\right)}.\tag{4}$$ The complete elliptic integral of the second kind is related to the perimeter of an ellipse, and a very good algebraic approximation is due to Ramanujan, besides weaker inequalities such as $$ 2\pi \left(\frac{a^{3/2}+b^{3/2}}{2}\right)^{2/3}\leq L(a,b)\leq 2\pi\sqrt{\frac{a^2+b^2}{2}}.\tag{5}$$ Other info are contained in the chapter of these notes about elliptic integrals.