As said I got the Applescript part with returning a custom attribute back to Hazel working:

However the Applescript condition (which subsequently calls a shell script) is a bit more expensive than the other conditions and it errors out when the input is not as expected.
So I would like to test the Applescript condition only when the other conditions are met. - How can I do this?
Thanks for pointers.