One solution would be to modify the $statement variable like so:
$statement = 'return $cat_id > 5 && $cat_id <= 20;';
That way you could then use [man]eval/man on the variable in an if() statement. Note that I also added a missing dollar sign on the second instance of 'cat_id' - remove this if you actually did have a constant defined called "cat_id".
As dagon asked, however, I would be interested to know why you're doing this? As the old saying goes, "If eval() is the answer, then you must be asking the wrong question."