Short answer: You said it: "while typing". LaTeX code can be typed with any text editor and even any word processors, so this is a problem of the editor, not the LaTeX code, that it must be unambiguous. Use a editor with this feature, as TeXWorks.
Long answer: Since pdflatex, xetex, etc work with an already typed code, a LaTeX solution would require a posteriori the interpretation of your thoughts in that you have typed, a needless complication in IMHO. For instance, what to do with this simple code?:
\documentclass{article}
\begin{document}
2", 5" and 7"
\end{document}
May be you want here 2``, 5'' and 7", or may be 2", 5`` and 7'' or simply 2", 5" and 7" exactly as you typed? What to do if this interpretation is wrong? It will be a pain if you need to re-edit to be more specific about what you want really.
Instead, if the interpretation of your thoughts is done by the editor, misinterpretation is less painfull. Following the example, if you typed in TeXWorks 2", 5" and 7" and "more" will be typed 2'' and 5'' and 7'' and ``more'' (note that each " are now two characters) that probably is what you want, but in other case you can change easily in a second.
Anyway, this feature is not painless, since this force that " (single character) must be obtained with Ctrl+Shift+2 instead of the usual Shift+2.
\documentclass{article}\usepackage{csquotes}\MakeOuterQuote{"}\begin{document}"Hello"\end{document}(this will probably not work withbabeland a language that uses"as shorthand...) – cgnieder Jul 31 '13 at 15:23perlscript is the way to go. As for the philosophy, this is for historical (and still surprisingly relevant) reasons: there are no 'smart quote' characters on the keyboard. (And for the record, this is not a LaTeX decision per se, but a TeX decision made be Knuth himself.) – Sean Allred Jul 31 '13 at 15:31”s, and in this sense, the "default behavior" of MS Word is better than latex compilers. – Daniel Jul 31 '13 at 20:30csquotespackage as suggested by @cgnieder. It does exactly this and has the additional advantage that you could easily change the actual quote style (single, double, french quotes...) in a central position. – Daniel Aug 01 '13 at 06:01