Yes, I firmly agree that it was a Deus ex Machina- much like Yellow's combined attack for the power of good restoring Kanto was one. However, I do believe that it was necessary to the story.
First of all: It was forshadowed from the very first volume. Sapphire reveals that Celebi was used in the inital battle against Seviper. Although we could not see Celebi in this battle, we could infer its presence by the fact that Sapphire's wounds are not bandaged- like they would be if Ruby had truly used a first-aid kit- but healed completely to the point of it appearing that the wound had never been.
Secondly: Celebi is a Pokemon that can travel through time and therefore can see the future. It knew that Hoenn would be essentially utterly obliterated and wished to stop it. How did it do that? By placing itself near Ruby. And why did it pick Ruby? Not simply because Ruby would move to Hoenn, no. Remember when Pryce attempted to capture Celebi- he did it solely for the purpose of reviving La Pris and La Prus. That is the memory he would most like to change. Remember what the point in Ruby's life he would most like to change is: the moment when he made Sapphire cry as a child. Celebi picked Ruby because it knew that Ruby, despite all of Ruby's character flaws, would have the inner integrity to not cheat the past and instead move forward to preparing a better future. Which leads me to my third point.
Thirdly: The Hoenn games and manga are a warning to us about the future of our world. They always have been, they always will be. The ocean waters are rising, volcanic activity is ceasing, earthquakes and droughts are plaguing the land. A whole is blasted in the ozone to wake Rayquaza. IGN can have its fun, but it is no coincidence that our second trip to Hoenn is greeted with more water and higher sea levels than the first. The dire ending shows us a world where our selfish human interets fully run their course. The world is shattered, towns destroyed, and Ruby is forced to face the death of many he knows or cares about. Celebi fixes the situation because a. this is a kid's manga and b. Celebi is showing us that we can solve our problems and stop this future before it happens. We have witnessed two endings to our problems- one where it ends in destruction and horror, and one with peace and friendship. The Celebi ex Machina is utilized right because it is supposed to remind the reader that, as Ruby changed his future, we must change ours. As a final warning, the authors left us with Celebi because although we can do a quick fix in a fictional world, we can never have one occur in real life.
Additionally, after rereading the Ruby sapphire arc, I want to comment about the lack of Sapphire's involvement in the final battle.
The battle between the legendaries had to be resolved by Ruby and Ruby alone because he was the one who started it. A normal child would not have attacked the Salamance five years before. A normal child would have ran away or called for help. However, Ruby's pride made him believe he could defeat it. It was Ruby's- that is to say, humanity's- hubris that caused the disaster and therefore it is his duty to fix it.
Sapphire and Ruby battle Maxie and Archie together because it is a battle of humans. Sapphire is an excellent character plot-wise, but she does not represent humanity as strongly as Ruby does. The final battle is being driven by plot. It's no longer a metaphor. The warning has been given, and it is up to the reader to see it and understand.
I was discussing the conclusion of a Pokemon Adventures story arc with Malice beforehand. I decided to add a few points on our conversation via message wall. Please forgive me if my writing could not be easily understood.