I think I've read here that it makes sense to bundle the various UDFs that you use into a single file, and then call it from your script. But is there a practical limit as to how large I should let it become?

It's probably unrelated, but running IsInSubnet with the function code in the same script is working fine, but calling it from another script is causing an error. It's not just that it can't find the file, it's saying "expected expression" in a line that is part of the function code.

I can't find anything wrong with it.

Exact Error is:

expected expression: $h=''+$h+iif($/8,'255',$f[$ mod 8])+iif($g<4,'.',''

which appears in this part of the UDF:
Code:

;Begin build mask array (Howard Bullock)
$f=0,128,192,224,240,248,252,254,255
for $e=0 to 32
Dim $h
$=$e
for $g=1 to 4
$h=''+$h+iif($/8,'255',$f[$ mod 8])+iif($g<4,'.','')
$=iif($>8,$-8,0)
next
$m[$e]=$h
next