I use a timer:
Code:
on *:CONNECT: {
timer 0 30 /pcheck
}

alias pcheck {
  if ($status = connected) {
    /raw pong FD411636
  }
}