Is there any way to get the magnetic lasso tool to snap up to the edges of the canvas instead of wiggling its way along beside the edge? One would think that positioning the lasso pointer outside the edge would do it, but that leads to the following result:
While using the magnetic lasso tool, when you come near the edge hold the Alt key and click which will switch to straight line. Now move outside the edge, click, move to the other end, click. When you are ready to switch back to the magnetic lasso, Alt-Click on the next point. This will give you an on the fly switch lasso tools.
Of course, as suggested in the comments, using a quick selection tool is an option as well.
Clicking-and-holding during a magnetic lasso will cause the tool to "lose it's magic", and behave like the standard lasso tool, until you release the mouse button again.
So, when you're approaching the edge, click and hold, then move outside the edge of the doc, just as you tried. At the point you want to resume magnetic selection, let go of the button and continue tracing the edge.