Opportunity Cost of Borrowed Money question...

I have a question on how to value a certain type of opportunity cost: An individual investor buys 1000 shares of XYZ at 10.00. He uses 5,000 of his own cash and borrows the other 5000 at .0975%. A year later he sells the 1000 shares at 11.00. He has paid 975 in interest He has received 975 in dividends He paid 20 in transaction costs Return: (11-10)*1000 = $1000 *(interest and dividends cancel each other out) So the investor put up $5000 of his own money and after paying back the $5000 loan, he has $5980. 5980/5000= .196 or 19.6% return When incorporating opportunity costs you need to include the next best alternative that he could have done with the cash he put up. Let’s assume his best alternative was to put it into a ‘high yield’ savings account (Risk Free rate) and get 4%. That takes care of the opportunity cost of the $5000 that he puts up himself, but how do you incorporate the opportunity cost of the $5000 he borrows? Let’s say the individual has total credit lines of 10,000 at 9.75%, how do you quantify the opportunity cost of using half your available credit. For an individual like this some costs of using credit would be: -Less credit available for future unexpected costs -Risk that the stock goes down and he has to go out of pocket to pay back loan Any way to quantify these risks/opportunity costs?