luup code to Restrict scene trigger from happening based on pin code

First I will start with I absolutely know nothing about lua coding. Here is my issue, I currently have 3 yale YRD220-ZW lever locks on 1 build with a current 45 pin codes. I have several scenes set up that work wonderful but they are based on the door unlocking(in away mode) so I didn’t have to enter a trigger for every pin code in every door for 42 pin codes or 3x42=126 triggers. I have 3 pin codes setup that run another scene when used but unfortunately they also unlock the door at the same time. This scene actually has veraedge switch from away mode to home and the other scenes are set to only work in away mode but apparently that restriction is only valid during the intial trigger and not when the device action happens. These 2 scenes then conflict in what I really want the devices to do. I would assume there would be a way to write a luup code into the trigger event that if it’s this pin or this user that the trigger is false and cancel this scene action. If so this would fix all of my issues. If the veraedge would be set up to pick pin codes for triggers like devices, that way you could just but a check by all the pin codes you wanted to use it wouldn’t be much of a big deal but the current way I will have to set up 126 triggers to get this to work the way I need unless I can restrict certain triggers with luup code. Thanks in advance for any and all help.

You might take a look at:

http://forum.micasaverde.com/index.php/topic,18679.0.html

Or PLEG.

Note: You can have a single trigger using the wild card code of “*”
Then in the code you can get the ACTUAL code used and decide what to do and return true (continue the scene) or false (cancel further scene processing).