Custom Dependency Criterea for Matix

I would like to create a matrix that  ensures that the part properties of a block, are a superset of the content of 2 smart packages.  I created an opaque expression to access the part properties, and to create the smart packages.  I am using the  content of the packages for  my columns and the  part properties types for my rows.  (all elements are of the same type).   

I found a rather non-elegent way of using intersections to accomplish my matrix task, but I  think that I could replace my query with a script.  I can access the row element in my script as it is the context.  I would assume that the query iterates through columns.  Is there a way to access the current column to determine if it has the same name as the row?   I know that I can get the name of the matrix and iterate through the columns, but I don't think that will work.