Forcing together line items of the same unit type in Rooms and Commerce
When editing the field display formatter for the product reference, there is an option you can select to combine like products in the cart: 



If that's selected, then you can dig a bit deeper by looking at commerce_cart_product_add(). The logic to reckon a combination starts about a third of the function down. The biggest thing here is the comparison properties. Commerce uses at least two fields initially to determine if a product is a "like product": type and commerce_product. Then, it will add any fields that are exposed to the add to cart form, and finally you can then view or alter these fields by using hook_commerce_cart_product_comparison_properties_alter().

Effectively, it won't allow any products to be combined that do not sure the same SKU or unique properties that identify it.