It is wrong the other way.
When I go in a shop and use a coupont, the coupon is gone,.. when I do refund, I may get another coupon. From my point of view it is absolutly correct that a coupon is gone in the moment you have it in the cart and press "confirm checkout".
In your case, someone can checkout more than once with ONE coupon.
When you set the first order on confirmed,... the invoice of the others must be blocked and set to cancelled. Stan logic is imho clearly hackable.
So from your point of view is normal that a customer that checkouts and makes a failed order (pending or cancelled) looses his coupon?
With Stan's logic the coupon is used (deleted) when an order is confirmed or any other selectable status, why should customers loose coupons on pending or cancelled orders?
How can you hack that if the coupon is deleted after a succesfull checkout?
Yes they can checkout several times with ONE coupon until the order is confirmed and therefore the coupon is really used.
The actual logic of VM makes us admins have to manually re-create coupons when customers fail to checkout succesfully when using a coupon.
A refund again is a manual process where admins will have to set that status to restore the coupon so you are loosing orders there due to customers not being able to use their coupons anymore since VM deletes them always, independently of the order status.
Don't know what is the best solution but I don't think that loosing coupons on pending or cancelled orders makes much sense no?
Regards