Is this some script? Or he writes them manually?
The comment in your example is not quite typical. It is copied from Workplace meta. They get this particular kind of troublesome questions much more often than Programmers, that's why they invested extra effort into writing detailed description of what's specifically wrong with it.
As for the nice tone of this comment, this is, again, kind of a brand mark of Workplace. Moderators and active regulars over there are fond of expressing the critique in very polite way and as far as I can tell, they do it really well.
You can bookmark and refer appropriate sections (answers) in their meta post when you see workplace-y questions that don't look OK, although as I already mentioned Programmers get these quite infrequently.
For more typical issues in the questions, I refer respective posts at our meta, conveniently listed in FAQ: Why was my question closed or down voted?
One thing I'd want to warn against is referring that whole FAQ instead of meta posts specifically targeted to address concrete issues in the post you comment on.
Granted, I haven't seen our regulars (mis)using FAQ like that but I believe it's important enough to explicitly warn against this. Askers are unlikely to pay attention to your meta references unless they can easily see how it directly applies to specific issues with their question.
As for technical means to make it easier, as pointed in comments, StackApps have special "pro-forma" script for that (discussed in details at MSE). Note that if you switch browsers or machine you'd lose data for this script, so you may prefer to simply keep comments in some file and copy from there.
gnat is a mechanical being who monitors several sites on the SE network: as soon as a question is posted, gnat's AI kicks in and figures out the proper comment to post.