Extract SMS messages off iPhone 4
Do a backup of your iPhone.
Backups are located here here ~/Library/Application Support/MobileSync/Backup.
Find there a file called 3d0d7e5fb2ce288813306e4d4636395e047a3d28 (it might have some extension, can't remember from top of my head if it has one at all).

It is an SQLite db file so you can open in in SQLite browser of your choice then and access all your text messages.