I like to use the IID instead of the UID, because it's fixed.
If you hardcode using the UID, you could accidentally change all the UIDs in your game and you'd have to change each line of code manually (at least that happened with C2 a while ago, not sure if this still happens).
Let's say you have 3 doors in a layout; if you pick them by IID, their respective numbers will be 0, 1 and 2, in the order they were created.
IF player entered door
AND door.IID = 0
-> Go to layout