I had a similar dynamic camera in my Ludum Dare48(i didn't finish).In my game i use a group to put the zoom, and then i compare the distances between players to activate and deactivate the zoom to fit your needs,if you don't need full zoom when the players are to close.
By the way sqiddster example is more elegant than mine, i think i'll switch to this <img src="smileys/smiley2.gif" border="0" align="middle" />