EDIT: I should have read your question more thoroughly before answering.
There is no legal way of editing the keyboard in iOS on the iPhone. As per my answer below, you want to be able to "intercept" the textfield/textview used by the MFMessageComposeViewController.
From studying the MFMessageComposeViewController class (and it's delegate) there is no public way to "intercept" the message being input by the user. The best you can do is to start the user off with some text for their message.
If you wanted to achieve this, which maybe possible through sub-classing MFMessageComposeViewController (and finding out what the textfield/view instance variable is), it is quite likely that Apple may not accept your application to the App Store.
Old Answer: If you want to do something like this you need to look at the delegate methods for the UITextField (UITextFieldDelegate). There are number of different approaches you could take.
textField:shouldChangeCharactersInRange:replacementString: - implementing this method will allow you to change characters as it they are entered.
textFieldDidEndEditing: - implementing this will allow you to "intercept" the textfield that has been edited. In turn you can use the textfield that is passed into the method to get the string and manipulate or change words as you wish.
If you are using a UITextView, it also has its own delegate (UITextViewDelegate) with very similar methods you can implement to intercept the text entered by the user.