In mIRC 6.03 there is now an easy way. This is from
versions.txt of mIRC 6.03:
50.Can now specify %variables in a dialog item definition, and the
%variable will be set with the contents of that item when the
dialog is closed, eg.
edit "", 2, 10 10 100 20, autohs %test