Testing I did:
* Ran side-by-side with the current version on a few ports, both with a lot of options and a few options. Results were identical.
* Ran on one particular port where I needed ordering. Result was as expected.
* Noticed that when dialog4ports happens to fail, errors go unreported. Reported this to portmgr@: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224738
I don't think that the last item should prevent this patch from being committed, because this is a preexisting problem, and it can be fixed any time.