well you must be doing something wrong then since this is not the way it should be :-P when typing that you connect to the network as normal, unless you added it to your hosts file with loopback IP and use port 6667 for the tunnel.
what you need to do is figure out the IP of one of the servers of freenode you want to connect to (irc.freenode.org has more then 1 IP associated with it, it's a roundrobin system, pick one of the individual servers). add that to putty's tunnel list, on a nice port (I use ports above 60.000 (e.g.: 60667) most of the time), and use /server localhost:60667 to connect to the server through ssh (putty).
I've never had problems with this before and works like a charm (also on freenode).
but I've never had to use $server and $serverip myself for scripts or anything.