I also noticed recently that, in a somewhat shell-like way, you can press the up arrow to edit your previous message at will (but perhaps this is common knowledge).
As a suggestion, you could search the line for the substring with the least Levenshtein distance from the correction, to use as the text to replace—and thus also support the "*word" correction syntax I see quite more often from non-technical friends. :)
I believe (though am likely wrong) that the *correction format originated in IRC, where you can't edit text once you've sent it... though I now see s/wrd/word/ quite often too - but that's mainly in technical rooms.
I also noticed recently that, in a somewhat shell-like way, you can press the up arrow to edit your previous message at will (but perhaps this is common knowledge).