You do not pay tax if you re-pay the loan. If you do not re-pay it, then it is treated as a distribution and you are taxed -- including any early withdrawal penalty.
**Disclaimer: Every effort has been made to offer the most correct information possible. The poster disclaims any legal responsibility for the accuracy of the information that is contained in this post.**