Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
It's not clear to me that the procedure described above wouldn't favor certain isomorphism classes. The original question wanted an equal chance at each isomorphism class of groups of order $n$.
Indeed, GAP even knows the count of these groups with NumberSmallGroups (but it won't let you get at the groups themselves via the SmallGroups library).