Sounds like you want the app called "
Touch In-Call Screen Tweak". It was made for turning the screen off when the phone is put to your ear, and automatically turning the screen on when you pull it away from your ear so that you can input numbers, and it has an option to automatically press left softkey when the screen comes on, which will show the keypad, it will even turn on the speaker phone when you pull the phone from your ear. I use it and love it.