There are many options. I don't have time for details... Now, just some directions.
1. Section Access with initial data reduction (or initial data selection)
2. Selection by OnOpen trigger. Maybe also locikng the selections
3. Filtering in the load script as you have now, but the condition is a variable, so it can be modified from the front end.
Best way - depends on the specific needs.