There is the Settings -> General -> Allow customer to signup for user group setting. But the customers cannot choose user group if the registration process is on checkout. Also all user groups requests should be approved by admin
A government agency or corporate customer is not to be halted in the check out process, just to wait for an admin approval to get an invoice payment option.
Credit cards is only to be connected to 'Privat' accounts.
You can create an addon that will see if the user is logged in or not. And if not, to have them select their usergroup. You would need to carry this info into a post-registration process (like register after checkout) so that group is preserved. Usergroups do not need to have admin approval if you don't want them to (I don't believe - requires investigation)
So your addon could behave like this:
+ user registers - selects usergroup
+ on checkout, if user not logged in and beyond step 1 (I.e. they've chosen to checkout anonymously). present them with a usergroup selection probably at the billing/shipping info step.
- The usergroup should be active even though they are not logged in. However, there may be several places in core code where it only looks at usergroups if the user is logged in (requires investigation).
+ At end of checkout and user elects to create an account, the usergroup selected should be maintained
How do you plan to verify that someone is in government or a corporate user versus a retail user? I'm guessing you are doing things differently based on their selection.
In any event, if you'd like to submit your requirements by clicking the link in my signature, I'd be happy to help you solidify them and give you a quote.