Improve on when to add closing counterparts.
Improve on when to add closing counterparts.

Previously the closing part was just not inserted before any word chars
(`\w`); now it is added before whitespace and any char listed in
AutoClosePairs.

This fixes putting a "(" in front of e.g. "$", so that you do not get
"()$", but "($" instead.

Check for defined pair and check early.

It could happen that a:char was not defined in b:AutoClosePairs (because
it got removed according to the filetype probably).

This commit now checks for the pair to be set.

It also moves the b:AutoCloseOn and s:IsForbidden checks up to the
beginning of the function.

iff/dotfiles-old,iff/dotfiles-old