Couple things... I just downloaded the zip file today...
1. In "catalog/includes/classes/shopping_cart.php", there is a hard coded date and time where it checks for expiration .... Should this be changed to >= date("Y-m-d H:i:s") ???
2. Since I do need "multiple product from a category to get X free", I would like to create a separate contribution (based on your code) that will detect multiple products under one category in a cart and add the specified free product to the cart. I've been working on it tonight and I almost have the admin side working properly. It will get a little tricky with parent-child categories, but it should not be too bad.... This could be integrated at a later time.