The only likely line to cause an error is the
sockread -fn &r line.
28/07/2006 - mIRC v6.2
...
82.Fixed /sockread -nf bug, switches were not being parsed correctly.
You might want to check it's not that which is causing the error, not the $bvar() line.