I would like to chime in.
Participants actual account balance is the sum of the actual assets in his account plus the value of the outstanding loan.
Assets remaining after the loan - $25,000
Outstanding loan - $25,000
His account balance is $50,000
50% of this is $25,000
Less outstanding loan of $25,000
Remaining loan available is $0
You need to remember to add back in the loan since it is part of his account value before you determine the 50% of vested balance. Unless the asset value drops from the original time you took the loan, you should never get a negative answer.