How can I find the asymptotics of $h\int_0^{\pi}\frac{\sin^2(i\pi-he^{it})}{\sinh^2(he^{it})}dt$, $h\to0$, to evaluate a certain contour integral? $\newcommand{\d}{\,\mathrm{d}}\newcommand{\sech}{\operatorname{sech}}\newcommand{\csch}{\operatorname{csch}}$It was recently asked, and then deleted, how to evaluate the following using contour integration: $$I=\int_0^\infty\frac{\sin^2(x)}{\sinh^2(x)}\d x\overset{?}{=}\frac{\pi\coth\pi-1}{2}$$
There is a simple real method, and I credit @KStar for finding the series expansions:

If $f(x)=-\frac{2}{1+e^{2x}}$, then $f'(x)=\sech^2(x)$ and by expanding $f$ as a geometric series we find, for $x\gt0$: $$\sech^2(x)=4\sum_{n=1}^\infty(-1)^{n-1}n\cdot e^{-2nx}$$And letting $x\mapsto x+i\pi/2$ yields: $$\csch^2(x)=4\sum_{n=1}^\infty n\cdot e^{-2nx}$$For $x\gt0$. Then: $$\begin{align}\int_0^\infty\frac{\sin^2(x)}{\sinh^2(x)}\d x&=2\sum_{n=1}^\infty n\cdot\int_0^\infty(1-\cos(2x))e^{-2nx}\d x\\&=2\sum_{n=1}^\infty n\cdot\left(\frac{1}{2n}-\frac{2n}{4n^2+4}\right)\\&=\sum_{n=1}^\infty\frac{1}{n^2+1}\\&=\frac{\pi\coth\pi-1}{2}\end{align}$$By the Mittag-Leffler expansion of $\coth$, or equivalently via an argument using the digamma function.

The new user who posted and subsequently deleted their question suggested taking a rectangular contour, limiting in $R\to\infty$ on the rectangle with base $-R\to R$, of height $i\pi$, and with a semicircular inward indent around the point $i\pi$, say of radius $\varepsilon$. The integrand $f(z)=\frac{\sin^2z}{\sinh^2z}$ is holomorphic on the boundary and interior of this contour, so the integrals over all paths sum to zero. Moreover the small strips $R\to R+i\pi,-R\to-R+i\pi$ obviously vanish.
We have: $$\begin{align}\sin(x+i\pi)&=\sin(x)\cosh(\pi)+i\sinh(\pi)\cos(x)\\\sin^2(x+i\pi)&=\sin^2(x)\cosh^2(\pi)-\cos^2(x)\sinh^2(\pi)+2i\sin(x)\cos(x)\sinh(\pi)\cosh(\pi)\\&=\sin^2(x)(1+2\sinh^2(\pi))-\sinh^2(\pi)+2i\sin(x)\cos(x)\sinh(\pi)\cosh(\pi)\end{align}$$
For asymptotically large $R$, asymptotically small $\varepsilon\gt0$ we then need to use: $$0=o(1)+I-\int_{[-R,-\varepsilon]\cup[\varepsilon,R]}\frac{\sin^2(x)(1+2\sinh^2(\pi))-\sinh^2(\pi)}{\sinh^2(x)}\d x+i\varepsilon\int_{-\pi}^0\frac{\sin^2(i\pi+\varepsilon e^{it})}{\sinh^2(\varepsilon e^{it})}e^{it}\d t\\\overset{R\to\infty}{\longrightarrow}-2\sinh^2(\pi)\cdot I+\\\lim_{\varepsilon\to0^+}\left[2\sinh^2(\pi)(1-\coth(\varepsilon))+i\varepsilon\int_{0}^\pi\frac{\sin^2(i\pi-\varepsilon e^{it})}{\sinh^2(\varepsilon e^{it})}e^{it}\d t\right]$$
The original asker claimed that it is possible to use this method to calculate the final answer (they didn't go as far, but it was implied). Taking this on good faith, I will assume this works - but I am very uncertain how to do this. The limit of the semicircular integral is, well, nasty - I'd appreciate help with the asymptotics here. I am fairly certain my calculations thus far are correct, but I unfortunately do not own a copy of Mathematica or equivalent to help me here.
It is my (purely intuitive) suspicion that the limit does not exist, but this is weird since the limit must exist, as all the other limits do and the total limit of zero obviously exists.
To present a concrete target - to get the correct evaluation, we need to show that: $$\begin{align}2\sinh^2(\pi)(I-1)&=\pi\sinh(\pi)\cosh(\pi)-3\sinh^2(\pi)\\&\overset{?}{=}\lim_{\varepsilon\to0^+}\left[i\varepsilon\int_0^\pi\frac{\sin^2(i\pi-\varepsilon e^{it})}{\sinh^2(\varepsilon e^{it})}\d t-2\sinh^2(\pi)\coth(\varepsilon)\right]\end{align}$$
 A: Indeed, the method can be salvaged by taking the limits sufficiently carefully. Note that the contour proposed yields the equation
$$-2\sinh^2\pi\int_{-\infty}^\infty\frac{\sin^2x}{\sinh^2 x}dx+\lim_{\epsilon\to 0}\left[\left(\int_{-\infty}^{-\epsilon}+\int^{\infty}_{\epsilon}\right)\frac{\sinh^2\pi}{\sinh^2 x}-\\\int_0^\pi\frac{(\cosh^2\pi+\sinh^2\pi)\sin^2(\epsilon e^{-it})-\sinh^2\pi+i\sinh\pi\cosh\pi\sin (2\epsilon e^{-it})}{\sinh^2 (\epsilon e^{-it})}i\epsilon e^{-it}dt\right]=0$$
Now, we need to understand the leading behavior of the expression in brackets for $\epsilon\to 0$. The first integral is basically a principal value prescription with a double pole at $x=0$ and as such, is of order $\mathcal{O}(1/\epsilon).$ We expect this one to be canceled exactly. To this end we note that by expanding the denominator to leading order for the second term of the indent:
$$\int_0^\pi\frac{\sinh^2\pi}{\sinh^2 \epsilon e^{-it}}i\epsilon e^{-it}dt=-\frac{2\sinh^2\pi}{\epsilon}+o(\epsilon)=\sinh^2\pi\left(\int_{-\infty}^{-\epsilon}+\int^{\infty}_{\epsilon}\right)\frac{dx}{x^2}+o(\epsilon)$$
and we note that it exactly cancels out the divergent part of the PV integral. The first term of the indent vanishes as $\epsilon$ becomes small:
$$\int_0^\pi\frac{(\cosh^2\pi+\sinh^2\pi)\sin^2(\epsilon e^{-it})}{\sinh^2 \epsilon e^{-it}}i\epsilon e^{-it}dt=2(\cosh^2\pi+\sinh^2\pi)\epsilon+o(\epsilon ^3)$$
Finally, the third term tends to a constant:
$$\int_0^\pi\frac{i\cosh\pi\sinh\pi\sin(2\epsilon e^{-it})}{\sinh^2 \epsilon e^{-it}}i\epsilon e^{-it}dt=-2\pi\cosh\pi\sinh\pi+o(\epsilon^2)$$
Collecting everything we can finally evaluate the limit and rewrite the equation as
$$-2\sinh^2\pi \int_{-\infty}^\infty\frac{\sin^2x}{\sinh^2 x}dx+\sinh^2\pi\int_{-\infty}^\infty dx\left(\frac{1}{\sinh^2 x}-\frac{1}{x^2}\right)+2\pi
\cosh\pi\sinh\pi=0$$
Evaluating the integral by using the antiderivative $(\coth x-1/x)'=1/x^2-1/\sinh^2 x$ we have that
$$\int_{-\infty}^\infty dx\left(\frac{1}{\sinh^2 x}-\frac{1}{x^2}\right)=-2$$ and with this we  finally recover the result stated above.
A: Alternatively, we could integrate the function $$f(z) = \frac{1-e^{2iz}}{2\sinh^{2}(z)}$$ counterclockwise around a rectangular contour with vertices at $z=-N$, $z=N$, $z=N+ \left(N+ \frac{1}{2} \right) \pi i$, and $z= -N+ \left(N+ \frac{1}{2} \right) \pi i$, where $N$ is a positive integer.
The contour needs to be indented at the origin since $f(z)$ has a simple pole there.
Letting $N \to \infty$, the integral vanishes on vertical sides of the rectangle because the magnitude of $\sinh^{2}(z)$ grows exponentially as $\Re(z) \to \pm \infty$.
However, the integral does not vanish on the upper side of the rectangle as $N \to \infty$.
Notice that on the upper side of the rectangle, we have $$\frac{1}{2\sinh^{2}(z)} = \frac{1}{2\sinh^{2}\left(t+ i \left(N+ \frac{1}{2} \right) \pi \right)} = - \frac{1}{2 \cosh^{2}(t)}$$ for all positive integers $N$.
And on the upper side of the rectangle, the magnitude of $\frac{e^{2iz}}{2 \sinh^{2}(z)}$ decays exponentially fast to zero as $N \to \infty$.
So as $N \to \infty$, the integral along the top of the rectangle is tending to $$- \int_{\infty}^{-\infty} \frac{\mathrm dt}{2 \cosh^{2}(t)} = 1. $$
Therefore, we have
$$\begin{align} \operatorname{PV} \int_{-\infty}^{\infty} \frac{1-e^{2it}}{2 \sinh^{2}(t)} \, \mathrm dt + 1 &= \pi i \operatorname{Res}[f(z), 0]+ 2 \pi i \sum_{n=1}^{\infty}\operatorname{Res}[f(z), n \pi i ]  \\ &= \pi i (-i)+ 2 \pi i \sum_{n=1}^{\infty}\left(-i e^{-2 \pi n} \right) \tag{1} \\ &= \pi +2 \pi \, \frac{e^{- 2 \pi}}{1-e^{-2 \pi}}
\\  &= \pi \coth(\pi). \end{align}$$
Equating the real parts on both sides of the equation, we get $$ \int_{-\infty}^{\infty} \frac{1- \cos(2t)}{2 \sinh^{2}(t)} \, \mathrm dt = \int_{-\infty}^{\infty} \frac{\sin^{2}(t)}{\sinh^{2}(t)} \, \mathrm dt = \pi \coth(\pi) - 1. $$

$(1)$ To determine the residues at $z= n \pi i, n \in \mathbb{N}_{>0}$, we can use the double pole formula I used here.
$$\begin{align} \operatorname{Res}\left [\frac{1-e^{2iz}}{2 \sinh^{2}(z)}, n \pi i \right] &= \frac{1}{2} \lim_{ z \to n \pi i } \frac{6 \left(-2i e^{2iz} \right) \left(2 \cosh(2z)\right) -2\left(1-e^{2iz} \right)\left(4 \sinh(2z) \right) }{3 \left(2 \cosh(2z) \right)^{2}} \\ &= \frac{1}{2}  \frac{-24ie^{-2 \pi n} -0}{12} \\ &= -i e^{- 2 \pi n} \end{align}$$
