I took out a 401(k) loan and didn't regret it. It was basically a bridge loan. We paid it off in full within a year. Here's what I'd recommend:
1) Know exactly how you'd pay it off within 60 days before taking it out if you lose your job. If you can't find a way that you're 100% sure would work, don't do it. This can be credit cards, or family, or pretty much anything --but know exactly how you'd pull that off.
2) Know exactly how you're going to pay it off completely and quickly. You're paying interest into your 401(k) loan with post-tax money. You'll still be taxed on it again when you take it out in retirement. You need to minimize your exposure to that double taxation. Paying it off quickly is the only way to do that. But the more important factor is your job. No matter how secure you feel in your job right now, things can with time. If you can't pay it off completely within two years, I think it starts to get very suspect, because I don't think anyone can be that secure in their job looking that far out.
3) Make sure it's the right call financially. PMI could easily make it a good call. Having figured out how fast you can pay it off, you should be able to figure out how much it will save you on PMI. That could make it very attractive, but that needs validating.
Keep in mind that houses are big money sinks. However much you think you need for utilities, maintenance, HOAs, insurance, furnishings, principle, interest, taxes, and any improvements you're planning on: budget a bit more than that before estimating how long it will take you to pay it off. Most people underestimate a bit, so smart money is that you are, too.