My understanding (check with a tax expert, please), is that in scenario A you can repay the $100 share loan, and use the $50 profit (after taxes) for private purposes. Obviously you no longer have the deduction for the interest on the $100 loan. The complicating factor is how your loan was...