Hi,
there are multiple cases for your quastion:
1. Case N1: if you create down payment after creating SO -> there will be 2 invoices one for product another for down payment (it will be added as product "down payment")
solution : in this case just go to second down invoice with downpayment product and create refund for customer with amount "500"
2. Case N2: you just create journal statement ( receive money) and did not attach it to any invoice.
solution : In this case when you create SO -> invoice just add the amount "3500" to get invoice "In payment" => the customer will have remaining 500 in his account, then create another journal statement "send money" with "500"
Note: I've skipped reconciliation processes in my ansewr, if those cases do not referre to your case you coul give more information and i will update the unswer
Hope this will help