I made this for you, I hope it helps. Remember that this relies complete on the IRCd sending you the information and conforming to RFC.

Code
raw 2:*:{ set -e $+(%, ircdv., $cid) $8 }
alias ircdv {
  return $eval($+(%, ircdv., $cid), 2)
}


It's pretty simple. The RAW will get the version from the initial notice when you join the network and store it against the connection identifier. When you use $ircdv it will return the value on the server you're on like any other script.

Usage:

Code
on *:TEXT:!checkircdv:?:{
  if (ircd-ratbox-3.* iswm $ircdv) { .notice $nick Woah! This is RATBOX3!!! }
}


.. or as an alias

Code
alias checkircdv {
  if (UnrealIRCd-* iswm $ircdv) { echo -a .. We have UnrealIRCd! Uhoh. }
}


Good luck!