Can't you do it once for home purchase? You basically borrow from yourself in order to buy a house? Instead of paying a mortgage, you slowly redeposit the money back into your 401(k).
At most for $50k, so it would need to be a very cheap house. You can't borrow more than $50k or half of your 401k assets, whichever is lower.
You could take out for your down payment to avoid PMI, although I don't think that's what was being discussed in the example. (It wasn't worded so clearly to me though.)