Hmm ... as it is such a lot of code it's impossible to post it here.
I hoped that somebody had the same error, too, and found a solution.
If it is not a problem of the level_load command itself it might be a problem with a function still running in background ... but "Can't open file" would be strange in that manner.