you should create a separate page for managing the options rather than doing it on the product page. and another page for creating options groups and adding options to the groups
pass the product ID to the manage options page as a query string ID
add a form for creating a new option group
and another form for assigning options to the group and setting any unique attributes such as price or type.
use the manage relational table behavior to add the options to the product options table.