The problem is a result of the menus in the dialog. mIRC doesn't seem to be consistent with setting and retrieving the height of the client area of dialogs when a menu bar is present.
Simply find the difference and add it to the $dialog().ch value in the code.
-genius_at_work