A little rewrite so it's a single on JOIN event and so that you won't have issues rejoining multiple times after a netsplit. Also adjusted the counter as it was going to rejoin every 6 times instead of 5.
Code:
on *:JOIN:#specificchannel:{
if ($nick == $me) { .write log.txt I have joined $chan at $time(HH:nn) | return }
if (%vc >= 5) { .timerReJoin 1 1 hop | unset %vc }
else {
.write log.txt $nick Joined $chan
inc %vc
}
}