If you haven’t assigned it to any hook and you don’t call it, then it can’t work – this function is never called.
You should assign it to pre_get_posts
hook, I guess (at least it looks so).
Add this after your function:
add_filter( 'pre_get_posts', 'ah_meta_queries' );
It should work fine then.