I don't have a direct answer to your question, but your story does re-inforce why, when I'm flying to the USA out of YVR, I try to never connect in Canada - I always try to connect at a US hub. That way I clear customs at YVR and at least that piece is behind me.
Cheers,
Geoff Glave
Vancouver, Canada