All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The majority of scholars are of the opinion that repeating the Athaan is a recommended act of worship. However, the Hanafi and Ath-Thaahiriyyah scholars are of the opinion that it is obligatory. They acted according to the apparent meaning of the Hadeeth where the Prophet, sallallaahu ‘alayhi wa sallam, said: "When you hear the Athaan, repeat what the Mu’athin (i.e. one who calls the Athaan) says." [Al-Bukhari and Muslim]
Nevertheless, one who hears the call to prayer should repeat what the Mu’athin says even if he is reciting the Quran, unless he is praying. When one is in prayer, as I understood from the question, the majority of scholars are of the opinion that he does not need to repeat the Athaan. This is based on the Hadeeth where the Prophet, sallallaahu ‘alayhi wa sallam, said: "In prayer one is truly occupied (with a more serious matter)." [Al-Bukhari]
Maaliki scholars are of the opinion that he should repeat it if he is performing a voluntary prayer but not an obligatory one. Khaleel said: "Whoever hears the call for prayer should repeat it until the end of the two testimonies of faith twice during a voluntary prayer but not an obligatory one."
To sum up, when one resumes praying while hearing the Athaan, he is not sinful. Rather, what he is doing is sound according to the majority of scholars. However, it is recommended to lower his voice in his recitation in order not to confuse the Mu’athin.