I want to solve for the line integral:
$$\tag{1}\oint \alpha\nabla \phi_i\cdot \hat{\textbf{n}} ds$$
on the square boundary: $(0\le x \le 1, 0), (1,0 \le y \le 1), (1 \le x \le 0, 1),(0,1\le y \le 0)$
Where the function $\phi_i = \sin(n\pi x)\sin(n\pi y)$ and $\alpha = 1$ on the boundary. I don't know how $\hat{\textbf{n}}$ is oriented with respect to the gradient of $\phi_i$, so would it be possible to instead use Green's theorem $\oint_C Pdx + Qdy = \int\int_D \Big(\frac{\partial Q}{\partial x} -\frac{\partial P}{\partial y}\Big) dA$ and compute the double integral instead?

The gradient of $$ \phi(x,y) = \sin(n\pi x)\sin(n\pi y) $$ is $$ \nabla\phi=n\pi\pmatrix{\cos(n\pi x)\sin(n\pi y)\\\sin(n\pi x)\cos(n\pi y)}\,. $$ The divergence of that gradient is $$ \Delta\phi(x,y)=-2\,n^2\pi^2\sin(n\pi x)\sin(n\pi y)\,. $$ By Gauss' and Green's theorem \begin{align} \oint_{\partial\,Q}\nabla\phi\cdot\hat{\mathbf{n}}\,ds =\int_Q\Delta\phi\,dA \end{align} where $Q$ is your square and $\hat{\mathbf{n}}$ the outward pointing unit normal at the boundary.
It should be very easy to calculate the $dA$ integral over the square. If it is zero or not depends on whether $n$ is odd or even.
Since the function $\alpha$ is one on the boundary it has no influence on these results.