To answer the question of performance when checking the syntax on every cursor move, I had to implement this myself, and made this into the OnSyntaxChange plugin.
With this plugin, setting this up can be done in just three lines (e.g. in .vimrc):
call OnSyntaxChange#Install('Comment', '^Comment$', 0, 'i')
autocmd User SyntaxCommentEnterI silent! AcpLock
autocmd User SyntaxCommentLeaveI silent! AcpUnlock
For me, the performance impact is noticeable (depending on the filetype and syntax), but tolerable. Try for yourself!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…