At 215K-miles, you've done pretty good with a 4-matic. We have lots of them in Canada, and they're troublesome cars.
Selling it broken means taking next to nothing for it, but you'll have to seriously weigh what the value would be fixed. If you can't at least get back your repair cost plus 20%, then wholesale the car out.
At the mileage you're at, I'd start to expect some other potential repairs will be coming soon. Stuff like guides/seals, flex discs, suspension bushings, etc.
With the $3K that you'll spend o the repair, plus the $10K from your friend, and $3K for the car (worst case) you've got $16,000 to buy something with lots more life in it.
It's my experience that cars with 400,000 kilometers (240K-miles or so) really start to require costly repairs.
If you can handle the debt easily, I would serious check out ditching the car and buying "newer."
1998 C230 "Black Betty"