I believe it is the company's responsibility to repatriate you, no matter whether you resign or not. I also think that they cannot charge you for your visa full stop. That is a company expense according to Qatari Labour Law I believe. Call the Ministry of Labour and ask them.

Unfortunately, there are many companies here who try to claw back their expenses in hiring employees and do so illegally but employees are too frightened to stand up to them.
Signature line > "You can't fix stupid"