You could create a 100% discount coupon with these settings:
– Min. qty of matching products: 13
– Limit discount to: Every nth item
That will make every 13th matching product free. Please note that this rule will also apply the discount if you have 7 x product A and 6 x product B in the cart, is that a problem?