A 401(k) loan lets you borrow from your own retirement plan, usually up to half of your vested balance or $50,000, whichever is less. You pay it back through payroll deductions. Leave the job, and the deductions stop.

Many plans then want the loan paid off. If it isn't paid by the plan's deadline, the plan subtracts the unpaid balance from your account. That's called a loan offset, which means the IRS treats the unpaid balance as a withdrawal. It's taxable income, and if you're under 59½ there's generally a 10% penalty on top, with a few exceptions, like leaving the job in or after the year you turn 55.

Say $20,000 is still owed. In a 22% federal bracket, the offset adds about $4,400 in federal tax. The 10% penalty adds $2,000. Oregon's 8.75% bracket adds about $1,750. That comes to about $8,150, and the $20,000 is out of your retirement account for good.

There are two ways to stop it, and both need cash. The first is paying the loan off before the plan's deadline. Ask the plan administrator for the exact payoff amount and the date, because plans set their own. The second is a rollover after the fact. If the offset already happened because you left the job, you can deposit the same amount into an IRA by your tax filing deadline for that year, including extensions, and it isn't taxed. The catch is that the money for that deposit has to come from somewhere else, since the offset already used the money in the plan.

A line of credit can supply either one. Draw the payoff from a home equity line of credit or a personal line of credit, pay the 401(k) loan or make the IRA deposit, and then pay the line of credit down with your paychecks through Dynamic Banking. Dynamic Banking means running your income through the line of credit so every deposit lowers the balance and the interest. Paying $20,000 back over a year at 8.5% costs roughly $850 in interest, against about $8,150 in tax and penalty.

A line of credit is easy to get while you have a paycheck and hard to get once you don't, so if a job change is possible, open the line of credit, or confirm the one you have, while you're still employed. What lenders look at before they give you a line of credit covers the approval side, and what to do when your income drops partway through covers paying it back on a smaller paycheck.

I'm a licensed insurance broker, not a CPA, and plan rules vary. Confirm your plan's payoff amount and deadline before you move any money.

If a job change is even possible this year, call the plan administrator now and ask for the payoff amount. Plans set their own deadline after you leave, and it can be short.