1. Sync the iPhone so that everything is up to date.
2. Remove from iTunes, shut iTunes down.
3. Under General - Reset - Erase All Content And Settings. This takes the phone back to how it was out of the box. Like you do when selling it.
4. Have 027 sim installed, setup iPhone by connecting to iTunes, as a restore from backup. Its now ready to use, with all of your apps, etc.
Hopefully a restore from backup, to a blank iPhone will help. The beauty with iTunes is you can feel free to wipe the phone as the sync will restore all apps, contacts, etc, etc. Settings such as wifi password need to be re-entered, but thats about the only main setting, the others are just at defaults.