Just a few questions from my side of to understand it better.
Do you have the current roles installed or do they still need to be created?
Do you already use a plugin for your download page?
If no to both questions I might advice you to take a look into woocommerce https://nl.wordpress.org/plugins/woocommerce/ they might offer what you're looking for.
Here's an extra link to woocommerce and their roles / groups : https://learnwoo.com/woocommerce-understand-user-roles-capabilities/
A lot of wordpress sites use woocommerce to create a shop or a download page for their site.
https://yithemes.com/themes/plugins/yith-woocommerce-automatic-role-changer/?refer_id=1061975
The plugin metioned above might also help with automatic role changing?
Woocommerce is free but also offers prenium plugins to modify user roles
This is basically the only advice I have to look into woocommerce.