there are always reasons to reinvent the wheel... most shopping carts have a lot of features you personallly are not going to use... and miss a few features you need... and don't integrate well to exactly what you want...
also most carts you can user have this exact smae problem you mentioned...
here is something to think on: you could keep an array in the session...
$SESSION['page_visists_'] = array();
at ever page, push onto this, the page they just requested
array_unshift( $this_page, $SESSION['page_visists_'] );
now $SESSION['page_visists_'][0] always holds the last page they visited... [1] holds the next to last... etc
if you are storing the url_query along with the page name you could check to see if they have previously visited the cart with a query string of REMOVE_ITEM_ID=3, and then simply do not perform that action again.
i don't know if this will really work... but i thought it was worth mentioning