Ensuring Uniqueness Across Columns
For the timebeing we have implemented the solution found here: https://stackoverflow.com/questions/11414976/unique-constraint-on-two-columns-regardless-of-order

More specifically we have:


Added a Constraint so that TypeB must be greater than TypeA
Added a Unique Key for TypeA, RefA and TypeB
Added a Unique Key for TypeB, RefB and TypeA


This is a workaround as it forces changes to the business logic to ensure the products are sorted correctly before choosing which columns to add the information to.

Leaving this answer unaccepted in the hopes of a flashier answer.