Figured I'd circle back and fill in on exactly how long this actually took me.
The thing I didn't realise is that Immigration is *separate* from the usual customs check. So they do the customs check where your passport is stamped, then you have to head off to a different area to get your work visa. That's where my plans went a bit downhill.
I was in that immigration queue for 2 hours. Fortunately the queue had chairs, but it was still 2 hours of waiting in a room with poor air conditioning, when you've just flown for 13 hours and lack sleep! When I finally got to the front of the queue and handed my documents over, there were no questions asked, they were sending people back to their seats while they processed the documents. I had enough time to go to the bathroom and come back, at which point my newly printed visa was ready for me. Two hours waiting for five minutes of work...
Unfortunately this meant that my connecting flight to Montreal had taken off about 10 minutes earlier. While I was in the queue I had multiple immigration staff assure me that if I missed a flight due to immigration delays, that the airlines would accommodate that, and get me on another flight free of charge. This was very true, and when I got to the Air Canada desk and explained my situation, they put me onto the next available flight to Montreal. That was quite painless, and there was no extra charge.
The only downside to my travel plans was that my original flight had me arriving in Montreal at midnight, making it one of the last flights of the day. The next one wouldn't be for another 7 hours, so that was a long time waiting in Vancouver airport for what was supposed to be a very quick layover. It also ruined my jetlag plans of arriving somewhere late at night tired, going straight to sleep, and waking up in sync. I instead arrived in the morning a complete zombie and it took me a week before I could sleep properly again! On the upside, Vancouver airport is quite nice, and the wifi coverage is top notch! I was even able to find a quite corner to sneak a nap in. It's a good airport to be stuck in.
So in short, don't do what I did, 2 hours is too short a layover if you need to queue up at immigration, which is separate from your customs queue! But if it does go bad, it's not the end of the world, and getting yourself on the next flight is easy enough at no additional expense.