If not, it is a pretty close call in my view, but I think given that its your retirement money and that I don't think its a stellar year to be in the market anyway, I would probably repay some or all of it.
Just wanted to point out that in repaying the loan, it is basically the same thing as investing it - just within your 401K. When you put the money back in there, it starts earning for you again, instead of you paying yourself the interest. So either way if you invest the money or pay off the loan - you are getting market gains. But if you pay off the 401K loan, you are then free to change jobs as needed without risk of defaulting and paying a penalty.
I was going to point this out too--if it's not a stellar year to be in the market, i.e., you don't expect market returns >4.25%, or at least you want some of your 401(k) egg earning a steady return in cash rather than exposed to market risk, that's a reason not to pay off the loan. The effect is to keep that 40,000 in cash, earning 4.25% (from you). You the home mortgage borrower are breaking about even--4.25% is the going rate these days on a 30 year loan, and since the loan was for a home purchase you get the mortgage deduction--while you the 401(k) investor are getting a steady guaranteed 4.25%, which is better than you can do in bonds or T-bills these days.
Meanwhile, that 40,000 you're realizing from the sale of investment property? Plow it back into some other investment property. Rental property is a safe and productive investment, steadier than the market right now IMHO. (And even if you don't share MHO, it's good diversification.)