Sorry, i might have misread your post.
Currently the only way to sort would be alphabetically, if you want to sort by the order you enter the options, then we need to add another column to your optiongroups table (optiongroupsdate) and set the type to timestamp and set the default value to "CURRENT_TIMESTAMP" and then we can change the order to order by optiongroupsdate at line 429.