Since debug messages are disabled in the shipping build, there's no real practical way to tell 100% if your script is working as intended. But like I said, KOTOR is not really geared to do exactly what you want anyway, AI-wise. If you want something specific, you may have to brute-force it via scripting, with ApplyEffectToObject.