Hi,
having said that in my experience this process is completely manual, these would be the manual steps that I would do:
1) Create the return order for the customer with the good that is being returned;
2) Create the replacemnt order. On this replacement order select "Copy return order line" if you want to send the same item or do not flag it if you want to send a different replacement item;
3) In both cases on the replacement order you can then either modify the unit price lowering it, or apply a line-level discount so that you sell the good with a lower value/discount applied;
4) you will invoice the Return order;
To settle and refund the customer now you can choose either to:
5a) in the customer transactions settle the credit note with the invoice so that the customer has a balance (let's say -100+80=-20) that can be used for a discount on the payment for a future order
OR
5b) at the moment of posting the customer payment you will take these the invoice of the replacement order (let's say, 80) and the credit note of, let's say, 100) so that you will pay an amount of 20 to the customer.
Please let me know if something is not clear/does not add up