There is illegal use of PatternCount(), your function may be
PatternCount ( FieldtoCheck ; "#" ) > 0
You may want to block / \ : as separators used on Mac and Windows.
On Windows you also need to remove ? * < > | if I remember correctly.
Whether I create the filename or the user has some control, I still send it through a Filter() so that ONLY those alphanumeric (and underscore) characters are used in the actual filename. Since it's scripted, I will also set a field with that value, so the user knows the actual name of the file that was saved.
If the dialog allows the user to select a folder and manually enter a folder and filename, then the OS will have it's own validations. I try to avoid that if at all possible.
If I need greater control of file management, I'll use Troi File plug-in.