I completely agree with @ccstone, if you have deep or extensive text expansion requirements, a purpose-built tool for that job will do better than Keyboard Maestro.
However, in the interests of completeness here are two ways you could do it with Keyboard Maestro. The first is the simple way, pop up a Prompt For user Input window and ask for the name:
Or you can use regular expressions in the Typed String trigger and do it inline, like this: