Let \( y = y(x) \) be the solution of the differential equation \( \text{cosec}^{2}x \, dy + 2 \, dx = (1 + y \cos 2x)\text{cosec}^{2}x \, dx \), with \( y\!\left(\dfrac{\pi}{4}\right)=0 \). Then, the value of \( (y(0)+1)^{2} \) is equal to:
\( e^{1/2} \)
\( e \)
\( e^{-1/2} \)
\( e^{-1} \)