if you added that code to the checkout success page, it should not have killed the shopping cart.
There could be duplicate code causing the duplicate orders, maybe it is the code you are referring to for express checkout, or there could be 2 local checkout behaviors on the confirm page.