Let $f(z)=\dfrac{e^{i(\pi/2)z}}{1-z^2}.$
We want to find "$\int_{-\infty}^\infty f(x)\,dx$" and then take the real part. I have that in quotes as the integral is problematic unless we're careful about the singularities at $-1,1.$
A contour that will work contains the intervals $[-R,-1-r],$ $[-1+r,1-r],$ and $[1+r,R]$ (here $r,R>0$ and $r$ is much smaller than $R$). We also want the large semicircle described above. Around $-1$ we put the small semicircle of radius $r$ given by $-1-re^{it},0\le t \le \pi.$ Around $1$ we put the semicircle $1-re^{it},0\le t \le \pi.$ Hook these pieces up and orient the resulting closed contour positively. (It's good to draw a picture!)
Call this contour $\gamma=\gamma_{r,R}.$ Note that $\gamma$ does not contain either of $-1,1$ in its interior. Thus by Cauchy's theorem, $\int_\gamma f(z)\,dz =0.$
There are three intervals in this contour; let's denote the integral of $f$ over the union of all of them by $I(r,R).$ Note that $I(r,R)$ is real.
The first small semicircle:
$$\int_{0}^{\pi} f(-1-re^{it})(-ire^{it})\,dt=-\int_{0}^{\pi}\frac{\exp[i(\pi/2)(-1-re^{it})]ire^{it}}{1-(-1-re^{it})^2}\,dt$$ $$ = -\int_{0}^{\pi}\frac{i\exp[i(\pi/2)(-1-re^{it})]}{-2+re^{it}}\,dt.$$
As $r\to 0^+,$ the last integrand converges nicely to $\dfrac{i\exp[-i(\pi/2]}{-2} = 1/2.$ Thus the integral converges to $-\pi\cdot(1/2)=-\pi/2.$
The big semicircle:
$$\int_{0}^{\pi} f(Re^{it})iRe^{it}\,dt= \int_{0}^{\pi} \frac{\exp[i(\pi/2)Re^{it}]iRe^{it}}{1-R^2e^{2it}}\,dt.$$
This one's easy to estimate: Slap absolute values on everything to see the integrand is bounded above by $R/(R^2-1).$ (The fact that $\sin t\ge 0$ in $[0,\pi]$ comes in here.) As $R\to \infty,$ the integral $\to 0.$
The second small semicircle: Just like the first, giving a limit of $-\pi/2.$
So we have
$$I(r,R) + \text{ integrals over semicirles } = 0.$$
Our works shows that if $R\to \infty$ and $r\to 0$ (let $r=1/R$ if you like) we get
$$\int_{-\infty}^\infty \frac{\cos(\pi/2)x}{1-x^2 } = -(-\pi/2-\pi/2) =\pi.$$
Added later: Comment on errors you may have made. The problems start with "calculate instead"
$$2Re\int_{0}^{\infty}\frac{e^{\frac{\pi}{2}zi}}{1-e^{\pi zi}}dz.$$
I'm not sure why you changed $x$ to $z;$ we're still on the real axis at this point. But that's a minor thing. The big problem is the denominator. As others pointed out, it should be $1-z^2.$ It's important to get this right.
Onward to the pizza slice:
$$2Re\int_{0}^{\infty}\frac{e^{\frac{\pi}{2}zi}}{1-e^{\pi zi}}dz=\int_{0}^{2\pi}\frac{e^{\frac{\pi}{2}\theta i}}{1-e^{\pi\theta i}R^{2}}d\theta+\int_{0}^{R}\frac{e^{\frac{\pi}{2}\theta i}}{1-e^{\pi\theta i}R^{2}}dR+\int_{0}^{R}\frac{e^{\frac{\pi}{2}\theta i}}{1-e^{\pi\theta i}R^{2}}dR.$$
The minor things: You have the same integral added to itself at the end? Also, $dR$ is strange, as $R$ is a limit of integration. And we have an integral over $[0,\infty)$ equal to a sum of integrals over finite intervals?
I'll stop here for now. Can you explain the strategy? What is the pizza slice contour? We can converse on this if you like.