[closebrackets addon] Add more refined heuristics for when to close quote characters

Looks at token types to determine whether the quote would actually open a string

Issue #2657