That will only kinda work. I mean, 5 people joining the same channel could indicate a split but consider this:
I'm on #chan1,#chan2,#chan3,#chan4,#chan5.
My friend, who also goes to those same channels just connected to IRC, so he types:
/join #chan1,#chan2,#chan3,#chan4,#chan5
That script will register that as a netsplit. Imho a better way to do it would be to do something like %<thescid>.<thechannel>.<netsplitc>
The scid is because the same problem can potentially occur if 2 people join #chan1 @ DALnet and 1 joins #chan1 @ Undernet and 2 join #chan1 @ EFnet (assuming I'm on all those channels).