"....why didn't he get out sooner and stand for elections as a candidate?" Except for the unspecified term "sooner" isn't this exactly what he did?
After 26 years as a dictator? Yep...that's 26 years!