The best way to do this would be to click the Refund button on an existing paid invoice. Go through the standard refund process but don't click 'finalize refund' at the end.
Instead, go to the main invoice page and find the refund invoice. Add the new item to the invoice that the customer is purchasing as an exchange. Then mark the invoice as paid.
If the total balance on the refund invoice is a negative number, you owe the customer. If it's positive, they owe you.