That's an extremely inefficient way to calculate the size of a folder, as you are stressing the $findfile identifier. You are looping with $findfile, which for every iteration has to go and scan all files in the $logdir, and above that, for each iteration has to look for the Nth file.

Much preferable would be something like:

; Usage; $logsize

alias logsize {
var %a, %b = $findfile($logdir,*,0,inc %a $file($1-))
return $bytes(%a,m).suf
}

Note that when you try to use this method on large folders (as logdirs can get), that even this method will choke mIRC for a while. An alternative is using COM, which can pretty instantly return the size of huge folders. You could for example try $foldersize