Creating a Variable more like a button than a replace

I am using a MySQL datasource, and I would like to create a variable that acts like a button: ie, when you select a value of the variable, something happens that is not necessarily replacing the name of the variable with the value of the variable. I would like it to work basically like:

IF($Variable == value_1) THEN
SELECT * FROM table_name
WHERE $__timeFilter(Time_Stamp)

ELSE IF($Variable == value_2) THEN
SELECT * FROM table_name
WHERE id > 5;

This is just a basic example of the sort of behavior I want. Is this even possible? / How do I do it if it is? I’m trying to setup Grafana for use by people who don’t need to worry about what’s actually happening, so if I would like to avoid putting snippets of code as values in a custom variable that the end user would have to chose from.

Is there some way to have this end result while also making it more user friendly?

Thanks for any help.