Using a hand mixer or a stand mixer fitted with paddle attachment, cream the softened butter and both sugars together on medium speed until smooth, about 2 minutes.
Add eggs and mix on high until combined well.
Scrape down the sides and bottom of the bowl as needed. Add the vanilla and molasses and mix on high until combined.
Set aside.
In a separate bowl, toss the flour, baking soda, cinnamon, and salt together.
Add to the wet ingredients and mix on low until combined. Beat in the oats, raisins, and walnuts (if using) on low speed.
Dough will be very sticky and thick.
Chill the dough for 30-60 minutes in the refrigerator - if freezing dough, go ahead and use my tips above for perfectly frozen cookie dough.
Preheat oven to 350°F.
Line two large baking sheets with parchment paper or silicone baking mats.
Roll balls of dough (about 2 tablespoons of dough per cookie) and place 2 inches apart on the baking sheets.
Bake for 11-13 minutes until slightly browned on the sides.
The centers will look very soft and undone. Remove from the oven and let cool on baking sheet for 5 minutes before transferring to a wire rack.
Cookies will continue to set on wire rack - for best results, let them cool completely.