Pre-typing the message in some wordprocessing program is not a bad idea (I find even just using Notepad works fine for unformatted forum messages), but that pre-supposes that you know you're going to have a long post before you start writing it and that it's going to crap out before you get a chance to send it. And its a little bit of a pain for just posting quick messages on the fly. Okay, not really that much of a pain but you have to think to do it beforehand and most people are not about to go through that process for every message they post.
Kenj8 also had a good idea which you can use on those occassions AFTER you've just realized you've rewritten War And Peace (a feeling I think I know a little something about

). And it has the advantage of not requiring you open another program. However, even that has its shortcomings as you still have to remember to do it before you hit submit. And usually at that point you're probably so proud of your accomplishment that you're quick to hit that submit.
Here's one other approach that I've found sometimes works after you've hit submit and gotten that dreaded sign-in again screen. Enter your handle and password and hit login
AND THEN as soon as you get to the next screen hit the back button twice Very often that will take you back to the "Post a reply" edit screen WITH your original message still in the text box. I'm not sure this will always work. Sometimes the text box comes up empty. But often it does and you can then just hit the submit again knowing that you've just signed in recently and are safe. That method has bailed me out on more than one occasion,
but you have to back up as soon as you're relogged in or it definitely won't work.
Edit: In fact, it just happened with this message. After re-logging in, I came to a scary looking "Post a reply" screen with a blank text box. I backed-up 2 pages and the text of this message came back. Now, I'll hit submit and if you see this message you'll know it worked.