Exactly. This is how IRAs already work. Taking a loan (beyond your basis) should count as realized income (while also adjusting your cost basis).