How are you hitting your chin on the keypad? Do you put the earpiece up to your ear?
There is a proximity sensor built into the phone, so when you hold it up to your ear, the screen will automatically lock.
However, if you're holding it to your mouth (in a manner such that your chin can actually hit the keypad), then obviously the earpiece isn't up to your ear and it can't lock.
I'm sure there's an app that can do this, but it'd probably be just as easy to hit the lock key up top.