Using butter instead of margarine will affect the shelf-life of the cookies. They’ll get stale a little faster with butter, but with margarine, will remain soft and chewy a bit longer. It won’t make a whole lot of difference, though. They might be good for three days on the counter with margarine, and two with butter. It’s the trade-off for the richer butter taste.
If you want them to last a week, then no matter what you bake them with, keep them in an airtight container in the fridge, and when you want to serve some, take them out about 20 minutes before you want them, and set them on the counter.
If you don’t care if they’re gone by the end of the day, then it makes no difference whatsoever.
But yeah, you swap butter/margarine 1 for 1.
For people who WANT to bake with margarine, a couple of things to look out for: buy one that says “Good for baking” on the label; otherwise, it’ll have to much water to bake well, and read the ingredients: some of them have milkfat as an ingredient, and there’s one on the market that has lard as an ingredient. If you need margarine because your vegan friend is coming over, you want to make sure you get a pure veggie oil margarine.