Calculating residue of pole of order $2$
Consider the residue of $f(z)/g(z)$ at the double pole $z=a$. Because $a$ is a double zero of $g(z)$, write
$$g(z) = (z-a)^2 p(z)$$
where $p(a) \ne 0$ and is analytic, etc. etc.
Then
$$\operatorname*{Res}_{z=a} \frac{f(z)}{g(z)} = \left [\frac{d}{dz} \frac{f(z)}{p(z)} \right ]_{z=a}$$
Now,
$$\frac{d}{dz} \frac{f(z)}{p(z)} = \frac{f'(z) p(z)-f(z) p'(z)}{p(z)^2}$$
Also, note that
$$g(z) = \frac12 g''(a) (z-a)^2 + \frac16 g'''(a) (z-a)^3+\cdots = p(a) (z-a)^2 + p'(a) (z-a)^3+\cdots$$
Therefore
$$p(a) = \frac12 g''(a)$$
and
$$p'(a) = \frac16 g'''(a)$$
Thus
$$\operatorname*{Res}_{z=a} \frac{f(z)}{g(z)} = \frac{6 f'(a) g''(a) - 2 f(a) g'''(a)}{3 [g''(a)]^2}$$
In your case, $f(z)=1+z$ and $g(z)=1-\sin{z}$. The residue at $z=\pi/2$ is then $2$.