Maybe it has a bad battery in it. I recently replaced a battery in an iPhone 4s CDMA and it worked fine and all but I found that the generic battery I bought on eBay when used in the phone made it turn off. I did alittle research on it and I found that some generic batteries cannot hold up to the power needs of the iPhone and when you try to draw too much power from the battery the phone will restart it self and the iPhone I have also goes into the off/on loop. Hopefully that helps you some.
My assumption on this is that you have a dead spot in your digitizer. To comferm this you should go to your home screen and try dragging an app all around your screen and if it goes back to its normal position when dragged over where "z" would be located its probably a dead spot. And I believe the only way to fix it would be to replace your screen.