The only problem I can foresee with this method is that the $inrect identifier uses pixels, and dialogs are usually made in dbu.
Fortunately, this dialog, and most of the others that I do use and create, use pixels, as I find they give me greater accuracy for positioning items that I want close together.