[eluser]WanWizard[/eluser]
Save $_SERVER['HTTP_REFERER'] in the session when a user requests the cart contents or presses on "checkout".
When the "continue shopping" button is pressed, check if you have this session variable, and if so, if it's a URL from your site (to prevent redirects to other sites), and if so, redirect() to it.