exactly. anything that is written from a character's point of view, relates to his or her experiences within the context of the show, and moves the story along.
now that definition gets tricky, especially in modern times with all the jukebox musicals. for example, I would classify anything from a show, i.e sound of music, or kiss me, kate a "showtune" but now, with shows like All shook up, or Jersey boys, songs that were not meant to be showtunes can now be classified as such, because they are included in the show. They weren't originally intended as a showtune, but I guess can now be classified as such for this purpose.
"I'm an American, Damnit!!! And if it's three things I don't believe in, it's quitting and math."