We need $\displaystyle\lim_{x\to(\pi/2)^+}\dfrac{b(1-\sin x)}{(\pi-2x)^2}=f\!\left(\dfrac{\pi}{2}\right)=\dfrac{1}{3}$.
Let $x=\dfrac{\pi}{2}-h$ where $h\to0^+$, so $\pi-2x=2h$ and $\sin x=\cos h$:
$x^2+2x-3=(x+3)(x-1)$. In $[0,2]$: root at $x=1$ (since $x=-3\notin[0,2]$).
For $x\in[0,1]$: $x^2+2x-3<0$, so $|x^2+2x-3|=3-x^2-2x$.
For $x\in[1,2]$: $x^2+2x-3>0$, so $|x^2+2x-3|=x^2+2x-3$.