Here is the math:
Assuming 35 years until retirement.
Assuming 3 years left and $10000 left on car loan at 3.9%.
Assuming you pay off the 401K loan at the same monthly payment as the car loan.
10% return over the long haul:
If you left $10,000 it in the 401k, it'll become $326,386
If you used the 401k to pay off the car loan, it'll become $298,194
You lose $28,193 with your idea (but that is taxed, so it is a bit less than it sounds).
6% return over the long haul:
If you left $10,000 it in the 401K, it'll become $81,236
If you used the 401K to pay off the car loan, it'll become $78,720
You lose $2,515 with your idea (but that is taxed, so it is a bit less than it sounds).
Even if you get low returns on your 401k, you still come out ahead by NOT using it as a loan. And you don't take risks. And like Elganja posted, you can refinance the car loan to something that is so near 0% that it isn't worth bothering with your 401k.
And one more potential risk: borrowing from yourself can be addictive. Suddenly without a car loan, you might get a new TV, get a new house, etc. Each time borrowing from yourself. But then, when you retire, you realize you have a bunch of old crap and an empty 401k. This might not apply to you, but I post it as a warning for others.