Try using $isfile() instead of $exists() and see if you have the same problem.
$exists() works in a clean install of mIRC, so it's one of the following:
* The file isn't where the script is looking. To test this, above that IF section, put:
run $scriptdir
That will open the folder that the script is looking in. Verify that the edit.key file is there.
* You have another script that is conflicting or part of the same script is conflicting. You'll have to test each part of the script to find where the conflict is located.
* You are using a hacked copy of mIRC that has bugs that prevent $exists from working properly. If that's the case, install mIRC from this site and try again.
* You have a comma in the path. I haven't tested this, but typically, a comma is used to separate items in an identifier and if you have it as part of the path, it may cause a problem.
Your comment about the comma would only be an issue if you used evaluation brackets ([ ]) to evaluate the contents.
Having a hacked version of mIRC is very unlikely.
Another option is that you have one or more spaces in the $scriptdir path.
Using $exists($qt($scriptdiredit.key)) will resolve the issue.
I like to use the $qt in my scripts that have to access the files in any directory as it returns properly whether there are spaces in the path or not.
You don't need to use quotes for paths with identifiers, only commands. There's no ambiguity as to where the path begins and ends with an identifier as the arguments are comma delimited, not space delimited like commands are.