The event.properties object is not a Python list of Strings, but rather a Java HashSet of Ignition Alarm objects. As such, you cannot use the Python in operator with a String to test if your property is in that set because the HashSet doesn’t contain Strings. Instead, you can iterate through the HashSet and check if the expected property is there. Here is an example of the code I have added to my script block in an alarm notification pipeline to achieve this:
myLogger = system.util.logger("myLogger")
for property in event.properties:
if str(property) == 'activeTime':
myLogger.info("Found property!")
Obviously, for your use case, you would swap ‘activeTime’ with ‘MessageCount’.