I'm still not having any luck, I feel stupid. I have changed my script to the following

$ipaddress=@IPADDRESS0
$iparray[0]='172.16.136.0/24'
$iparray[1]='172.16.137.0/24'
if isiniprange($ipaddress,$iparray)
use X: "\\apps\CDRoms"
endif

My only aim is to get machines on the 172.16.136.x range and 172.16.137.x to use X: "\\apps\CDRoms" .