Sorry, but you did not provide that information in your initial post, and I just assumed this was a regular mortgage.
Loans you took from your 401k account fall under a whole separate set of rules. When you take a loan from your 401k plan, you are required to pay back the loan in accordance with the terms set forth by the employer. During the months that payroll deductions were not made, you should have still made arrangements to pay your monthly loan payments on this loan.
If the loan is not brought up to date, then the 401k plan administrator is required to report the outstanding amount of the loan as a taxable distribution made to you, and you would owe taxes on that amount. This would be taxed as ordinary income, so the actual percentage of tax you end up paying would depend on your filing status and your total other income for the year, as this is what determines the tax bracket you are in.
In addition, if you are under the age of 59-1/2, then you would also owe an early withdrawal penalty of 10% in addition to the regular income taxes that are due.
There is really nothing you can do to avoid this situation other than pay the balance you owe to bring your loan payments up to date. You may want to consider taking out a home equity loan or a loan from another source to pay up your 401k loan to avoid this taxable situation.
If this was helpful please press the Accept button. It is the only way we receive any credit for helping with these questions.