Here is a corrected version that I think finally solves the problem of clicking the gear of a newly inserted comment action.
For more information, see the wiki Searching the Forum for Answers section.