How can I sort students automatically into groups during enrolment?
You can make use of enrolment keys. Set an enrolment key on the course settings page (to enforce the enrolment key dialogue form when students enrol). That key is only for students who should not be in a group. On the screen for administering groups, you create your groups and by editing the settings of each group, you can add a different enrolment key for each group. When a student enrols, using an enrolment key that is connected to a certain group, the student will automatically be part of that group.