Your calculations look correct to me, but I think this is perhaps meant to be seen geometrically (apologies if this is already obvious to you and you were looking for a non-geometric explanation).
Let the vertices of the triangle be $x$, $y$, $z$, starting at the vertex shared by the two squares, and labeling clockwise. Consider point $z$ as it is transformed by $\mathcal{M}$. A quarter-turn around $s$ must take $z$ to $x$; it's just a rotation of the square. Likewise, a quarter-turn around $p$ must take $x$ to $y$, and a half-turn around $m$ must take $y$ to $z$. So $\mathcal{M}$ takes $z$ to itself. By the quoted result, $\mathcal{M}$ is a translation, and therefore it must be the identity transformation.