Try adding a "NOT DB_TraitsModification..." line just prior to the DialogClearCharacterEvent line. The only thing I see that might be causing an infinite loop would be if the ClearEvent line is calling the event itself (or you can't clear it while the event is running?). You could try moving the ClearEvent line to the second block of code instead.