I think you need an "Auto transition listener". Try the one in the JIRA Toolkit addon - it was written for the cases where "user comments on closed issue instead of reopening it", but it more flexible than that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.