Element in rooms, transfer parameter value, values priority list

Hi everyone.
I created a script that allow me to transfer a parameter values from the rooms to all the objects that intersect the rooms volumes (with a 20mm offset).
Many objects intersects several rooms (which have different parameter values).
In that case I want to write the parameter value which has higher priority.
I have already a list with all the values ordered by priority (the 1st on the list has the highest priority).
Could you help me to do that? Thank you very much! :smiley:

Here is my graph so far. Any suggestions to how to make it better is also accepted :slight_smile: