it happens to my phone occasionally too.
Usually, restarting the phone will fix it.
What I do when I get that problem is sent it and while it shows that icon that it is still "sending" then I restart the phone. When the phone comes back up, it will either send the text for real, or it will show that it is already sent. Worst case, it sends it two times. But it fixes that locked up problem. most of the time.
It seems to be a problem with the way the phone talks to the network. Remember, just because you have phone signal doesn't mean you have data signal. And that is part of the whole problem with this phone since it was released. There is a hardware problem that causes "Data lock" I would be willing to bet that when you get that text message error, you can't access the internet either.
For whatever reason, the phone will reach out to the network to get a connection and it won't recognize that it has a signal. So it just gets stuck in this loop cycle waiting for the network to "ping" it back.
Take note of the symbol for data. Ideal it should be that EV over D symbol. the EV with the arrows is ok too. Watch it next time a message won't send, I bet neither, or maybe just one arrow lights up.
If you can take it back to the store and get it swapped out, then make that happen. You shouldn't have to pay any fee because it was a busted unit. The sprint store rep should be aware of this problem and work with you on it.
If you can't swap it out, then unfortunately, your only other option is to root the device and try a custom ROM. I installed the latest version of radioactive froyo and I have yet to have a data lock up and I have been trying to push my device hard for the past week solid so I know how it will hold up before rooting my girl's phone.
good luck