How can I hide the onscreen keyboard in the iOS messaging app?
This is not possible at all right now.
Like you said, you can back out and go in again to dismiss keyboard.
Other option is to tap the 'edit' button on top right. That will dismiss keyboard but it will go in edit mode. When you cancel out of edit mode keyboard will come back.

Apple should do something to easily bring up and dismiss keyboard...

Update: With iOS 5, you can swipe messages down all the way pushing the keyboard downwards. Initially I thought, "why not just swipe down the keyboard itself to dismiss?" But now it makes sense because you start scrolling down to see previous messages and keyboard naturally goes away when you do that.