I'm a bit leery of quotes because the open quote and the close quote are the same character. If you want to determine whether the quote the user typed is an opener or a closer, you have to look at the context.
I'm thinking maybe: If the user typed a quote, look at the previous character. If it's whitespace, or a colon, equals sign, or open bracket, or if you're at the start of the line (there is no previous character), then it's an opener and should be closed. Anything else, ignore it. Does that make sense to you? Too simpleminded?