[guided]We want to show that a weak operator limit of operators commuting with every element of $M$ still commutes with every element of $M$. Let $(T_i)_{i\in I}$ be a net in $M'$ and suppose $T_i\to T$ in the weak operator topology, where $T\in\mathcal{L}(H)$. By definition of weak operator convergence, for every pair of vectors $\alpha,\beta\in H$,
\begin{align*}
(T_i\alpha,\beta)_H\to (T\alpha,\beta)_H.
\end{align*}
Fix one operator $S\in M$. To prove $TS=ST$, it is enough to prove equality of all matrix coefficients. Thus fix $\xi,\eta\in H$. Because each $T_i$ belongs to $M'$, it commutes with $S$, so
\begin{align*}
(T_iS\xi,\eta)_H=(ST_i\xi,\eta)_H.
\end{align*}
Now we pass both sides to the limit. The left-hand side is directly in the form required by weak operator convergence, because $S\xi$ is a fixed vector of $H$. Hence
\begin{align*}
(T_iS\xi,\eta)_H\to (TS\xi,\eta)_H.
\end{align*}
The right-hand side is not immediately a weak matrix coefficient of $T_i$, because $T_i$ is followed by $S$. We move $S$ to the second slot using the adjoint. Since $S\in\mathcal{L}(H)$, its adjoint $S^*\in\mathcal{L}(H)$ exists, and with the inner product linear in the first argument,
\begin{align*}
(ST_i\xi,\eta)_H=(T_i\xi,S^*\eta)_H.
\end{align*}
Now $\xi$ and $S^*\eta$ are fixed vectors, so weak operator convergence gives
\begin{align*}
(T_i\xi,S^*\eta)_H\to (T\xi,S^*\eta)_H.
\end{align*}
Using the adjoint relation once more,
\begin{align*}
(T\xi,S^*\eta)_H=(ST\xi,\eta)_H.
\end{align*}
Therefore the common limit of the two sides is both $(TS\xi,\eta)_H$ and $(ST\xi,\eta)_H$, so
\begin{align*}
(TS\xi,\eta)_H=(ST\xi,\eta)_H.
\end{align*}
Because this holds for every $\eta\in H$, the vector $(TS-ST)\xi$ has zero inner product with every vector in $H$. In particular, taking $\eta=(TS-ST)\xi$ gives
\begin{align*}
\|(TS-ST)\xi\|_H^2=0.
\end{align*}
Thus $(TS-ST)\xi=0$. Since $\xi\in H$ was arbitrary, $TS=ST$. Since $S\in M$ was arbitrary, $T\in M'$. This proves that $M'$ is closed in the weak operator topology.[/guided]