API GetNumBattlefieldScores

Appears to return the number of scores in the battleground/field scoreboard:

local numBattlefieldScores = GetNumBattlefieldScores;

Which is an effective way of counting the players in a battlefield.