If you type an invalid channel or a channel you're not on, the script wouldn't find any matches and would not do anything. I'm not 100% sure what you mean though. Also, it is not meant to be multiple target (IE /partwild random sonic), but an idea for a future revision would be to parse the channel list to part instead of doing manual /parts for each matching channel (making a list like #channel1,#channel2,#channel3 and parting them in that way). This would prevent excess flooding and lagging due to sending so many requests at once.
This snippet allows you to part all channels matching a wildcard mask. Example: If I was in #Random, #Random_Sonic, and #RandomIRC, I could simply type /partwild Random to get out of those channels. This alias also supports a part message, which is the same for each channel. You can place this in your aliases.ini file (remove alias from the snippet), or in your remotes.