Yep, you've got it. The most beautiful part of the whole thing is the step up in basis for the estate. When you pass on your estate, the cost basis of all your assets get "stepped up" to the current market value. This means that if he passes on his estate to his children, they can then sell the shares to repay the loan with
zero tax.
All this adds up to zero capital gains taxes being paid ever on the entire amount.