The position and size parameters in the option hash are only initial anyway.
If you’ve properly wrapped the namespace for the extension and provided a preference_key parameter to the dialog, Sketchup will remember the last position the user set and display it next time where it was last. To override it, use the dialog.set_poistion(left, top) command after the dialog.show.
BTW, better to use instance variable for reference e.g. @dialog,
“If there is no reference kept to the HtmlDialog object, the window will close once the garbage collection runs. This behavior can be confusing in trivial test code but is usually not a concern in real life scenarios. Typically a persistent reference, e.g. an instance variable, should be kept to bring the dialog to front, rather than creating a duplicate, if the user should request it a second time.”