I often do iced cookies for Christmas. The key to ensuring that they don't lose their shape too much is to make sure that the dough is well chilled at every stage. You need to chill the dough once you've rolled it out, then chill on the trays after cutting. Make sure that the oven is at the correct temperature. Don't bake your cookies on a stinking hot day, as the dough starts to get really soft really quickly.
The problem, especially with sugar cookies or butter based ones is that the butter starts to melt in the hot oven before they begin to bake, so they start to spread. With chilling, the outside of the cookies tends to bake and hold it's shape better.
Yes, it's an extra step, but worth it if you're a perfectionist who won't be satisfied unless they are just right.