Buy it from the bank before he files
Why does everything that should end up being an easy deal turn into this? Get ready to loose some money thanks to your buddy!
I'm no lawyer but the only thing that even seems close to making sense it buying the other half fora discounted price but large enough that the loan is covered.
Another thing you may do is go talk to the bank that he owes for the boat. Show them you own half the boat, and he owns the other half. As an example if he owes $10,000 and is about to file for bankruptcy and you are willing to buy his half out for $7,000. They might just take it so they don't have to go thru the bankruptcy deal! You may come out better?