This is part of the problem when you are trying to customize parts of the solutions, they have been created for a very specific purpose and modifying them can be challenging. This recordset on the results page is probably one of the trickiest that I have seen, there is quite a bit going on here.
I think that a good place for you to try and filter the values from this recordset would be at this line:
FROM products LEFT OUTER JOIN productcategories ON ProductCategoryID = CategoryID WHERE
After this 'where' you might want to try adding in your filtering for the categories. This is a very custom use of the recordset and may require you to do a bit of testing and experimenting to get it rite.