To resize a dialog by script, I'd try something like this:
https://gist.github.com/behreajj/84f3cb95a8e66cc55c91e2bae360eac9
Here is the link to the reference entry for Dialog.bounds https://github.com/aseprite/api/blob/main/api/dialog.md#dialogbounds . You can also give an initial size and position to the Dialog:show https://github.com/aseprite/api/blob/main/api/dialog.md#dialogshow function. The bounds is a Rectangle https://github.com/aseprite/api/blob/main/api/rectangle.md .
You can resize dialogs manually by hovering the cursor over the edge of the dialog. The cursor should turn into a resize arrow. Then left click and drag.
I don't know of a way to get the screen's size in pixels, so there's a limit to what can be done with script.