Gaddafi did the right thing by stacking and keeping his stack in his home country not like some that have their stacks sitting in a foreign country.
But Absolute power has corrupted him absolutely, especially his mind. He should realize now there is no going back for the allies. He will be removed no matter what. There is no way they will allow him to cling onto power and than plot revenge against the west for his current situation. Think of the Lockerbie bombing and numerous other attacks he has organised in the past. His ego has clouded his judgment on this one and I think he is doomed. He didn't have an exit strategy in place which has now left him vulnerable. You watch as the Rebels gain more momentum you will see more defection from the military which is currently supporting him, just like we are seeing in Yemen now. That's the thing, if you leave it too late to defect than you are stuffed and will have to flee like a rat off a sinking ship or pay the ultimate price. It takes courage to defect early, as if you get it wrong you are gone, but leave it too late and you are gone as well. Those that defected early will gain much more power in the new order that follows than those that defect late.