^ I could custom code this for you but it's not an easy thing to state line for line.
You'd want to find where in cart.php after the product is added and it gets redirected. Then add the productid to to the redirect string. i.e. change cart.php in the redirect to cart.php?redirectproduct=PRODUCTID
Then in your cart.php when it is reloaded, grab the $redirectproduct variable and assign it.
Then edit your continue shopping code you can use something like:
Code:
<div align="right"><p align="right">
{if $redirectproduct ne ""}
<a href="product.php?productid={$redirectproduct}">
{else}
<a href="home.php">
{/if} Continue Shopping</a>
</p></div>