It appears I should have written the check like this:

if ( $checkspotforcounty(%filename) == $false ) {
...
}

At least mIRC isn't throwing up syntax errors on this one.

- Jim