A new tweak has been released in Cydia which will lock or mute your iPhone when you turn it face down. The name of this tweak is FlipOver. After you have installed this tweak on your jailbroken iPhone it will mute or lock your iPhone when you turn it face down and also this tweak will unmute or unlock your iPhone when you turn it face up. Simply go to settings.app to configure different aspects of this tweak.
FlipOver tweak is available in Cydia under BigBoss repository. It costs $0.99 USD. You should note that you will need to have a jailbroken iPhone to install this tweak. If you don’t have jailbroken iPhone then you can follow the step by step instructions posted here to jailbreak your iPhone on iOS 4.2.1 with Redsn0w. You can watch the video embedded below to see this tweak in action.