Donnie and Leo's personality quirks made perfect sense while really playing on the Middle Child Syndrome. In fact, all of their personalities tie into where they lie in the family.
Raph's the older brother. He feels the pressure to take care of everyone, worry about Mikey (the youngest), and protects his family. Mikey's the youngest, and he's the most childish (the drawings for Gamgam) and such while still getting the most headpats and crawling all over his brothers.
Leo and Donnie are interesting as middle children because they're both huge praise/attention whores, but in different ways. Leo's outgoing, he's the clown, he wants all eyes on him and likes showing off. Donnie also likes showing off, but he's more introverted about it. You see him lose his shit with happiness whenever an authority figure praises him for his tech, from Big Mama to Splinter to Karai. Donnie's the smartest so he can get aggravated about the fact his brothers are all dumber than him while still sometimes getting more noticed and being on par or better than him in some aspects (the whole Witch Town episode) but he's too prideful to admit this shit unless April and a giant troll beat it out of him.