in the eCart object, you can set the do not ship column to be unique.
This method would allow for the shopper to purchase the item twice, once with the shipping and once without. the shipping option would trigger a unique line item,
of course, if you don't want the shopper to be able to purchase with and without shipping on the item at the same time, using the the replace Quantity option in the add to cart button, as you have done, is the way to go.