I thought Gadget's upgrade was a bit silly considering the overall tone of the episode, a speed boost would be one thing but this was really over-the-top.
In addition to that being a matter of tricking the audience into feeling relieved just before the episode turns pitch black in tone, I think there's something else to remember, here.
Doctor Who is still aimed at a family audience. And, well, those Water Martians were
creepy. Add to that the sheer amount of emotional tension in the episode, the tone. I rather imagine that it could be a very scary episode for children!
So I think the function of things like Gadget is to help mediate the darkness and the scariness. The darkness is still there, the monsters are still coming, but there's a funny robot there to help the kids feel better, to help them process the episode over all. Sugar for a bitter pill.
I consider that thoroughly responsible storytelling from a creative team that remembers that they have a responsibility not to emotionally overwhelm audience members too young to fully handle darkness.