En+emdash.py

Creating en and em dashes from typewriter hyphens
This script is a stripped down and modified version of Autoquote.py. It might be more accurate to say that it was inspired by Autoquote.py, since there is hardly anything left of the original in the script you see below.

Instead of converting typewriter quotes to typographic quotes, here we want to set up a system so that we can type and enter '-' (a single hyphen) when we just want a hyphen, '--' (2 hyphens) when we want an en-dash, and '---' (3 hyphens) when we want an em-dash. If you have something like '' (4 hyphens) you'll probably end up with an em-dash followed by a hyphen.

There are no dialogs except for the message box at the end.

Usage of en dashes and em dashes
There are many resources on usage of dashes. This Wikipedia article is a reasonable resource, since it gives you a number of references so that you can get a broad sense of usage.

What you will find is that different publications or authorities have somewhat varying recommendations. In particular, there are differences between what is recommended in American versus British sources. To some extent, all agree that you should avoid overusage, and in addition use them in a consistent way.