What could be the reason to make timer initialization (InitTMR2) forever? ;-)
I think this is just phantom stubs code. Just delete this "do-while".
Also, I think the following article will be helpful for everyone. I read it with pleasure. https://www.nedbatchelder.com/text/deleting-code.html