See, you already learned the most important thing. You found out just how bad racing hurts. You already know the only way to inoculate yourself against the pain is to train that hard. Build a decent endurance base and do intervals, short and long. I like pyramid intervals (google 'em) and I like adding a run to the front of each one. It hurts pretty bad.
There are training tips all over teh interwebs, figure out what you need and have fun with it.
Ron