So... you probably don't need the custom form as discussed earlier... just change this code.
Also... you're doing a Log.Event. So, you need to make sure that under Tools -> Current Project Properties -> Playback you have the "Store last ___ events" set to 0. Events are suppressed unless an error or warning is logged in which case it will write out the number of events set in that value. If it's set to 0, all events get logged.
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group. I love good food, good books, good friends, and good fun.