Hi,
You can potentially use the mass actions via the menu System > Mass actions.
Create an action on the data "order" based on a cron, or an event, for example "after an order is created" and add filters like "user total purchase" <= XX, then in the action part select "change the user group".
This way all the customers with a minimum amount of orders are change automatically to a specific group, and finally in Orders > Discounts set a discount and restrict the access level t the desired group.
Be careful before using the mass action, thanks to backup your database.