For starters, Gandalf did remain after the third age. He NEVER let children fight and die. If you're referring to the hobbits, none of them died, and they were all about in their mid 40s, so hardly children. Clearing the battlefield with one spell would have ultimately lead to a total loss of the war. There are three giant battles in the war of the ring that Gandalf was involved in. Helm's deep. Gandalf only arrived at the end, and once he got there things were well under control. Minas Tirith. The battle of Minas Tirith was part of Gandalf's master plan, it was a trap. It was designed to keep Sauron's gaze fixed on his army, instead of looking for the ring. Even the Ringwraiths were there, instead of hunting down Frodo. If Gandalf had gotten rid of the entire orc army in just a few seconds, that would have very likely gotten Frodo killed due to Sauron moving his forces, and the Ringwraiths back to Mordor. The battle at the black gate was the same thing, a distraction.
Point number 2. Using magic weakens Gandalf. It makes him physically tired. Because of this he doesn't like to use big powerful spells unless he absolutely has to. As I said before, he attempted to use the most powerful spell in existence against the Balrog, but the Balrog is immune to magic, which Gandalf didn't know at the time.
Gandalf does actually use this spell one other time, though he doesn't unleash as much power as he could. Once again, Gandalf is a minimalist. Anywho, when the Witch King and the other Ringwraiths are chasing Faramir after losing Osgiliath, Gandalf releases a small blast of the Flame of Anor to drive them back. Which nearly kills them and their hellhawks. In the movies this is cheapened to a small ray of light coming out of Gandalf's staff. If you're familiar with Dragonball Z... It would have actually looked more like a kamehameha wave coming out of his staff.
The Flame of Anor is part of the Secret Fire, the spirit of Illuvatar, and the breath of all life. Using that power isn't something that Gandalf does lightly. When he has no reason to use it he doesn't just hit it for the lawls. And it looks to me like Gandalf used it the exact correct number of times. In the end everyone that could have been saved from the shadow was. The war that spanned thousands of years was finally over and the world was at peace. Really hard to argue with those results and say that Gandalf should have done more, when him doing more could have doomed them all.