Generally speaking, there are no rules preventing you from withdrawing money from your retirement plan because you are paying back a retirement loan. Depending on your situation and your retirement plan rules, you may be able to withdraw some of your retirement funds while still paying back a loan, as long as you have funds available for withdrawal.
Click here for more information about withdrawal availability.