Optional but recommended: put the raisins in a small bowl, cover with warm water and soak for 10 minutes. Drain and blot them very dry with paper towels.
In a large bowl, beat the softened butter, brown sugar and granulated sugar with a hand or stand mixer (paddle attachment) on medium speed for about 3 minutes, until smooth and creamy.
Add the eggs and beat on high speed for about 1 minute, scraping down the sides and bottom of the bowl as needed. Add the vanilla and molasses and beat on high until combined.
In a separate bowl, whisk together the flour, baking soda, cinnamon and salt. Add the dry ingredients to the wet ingredients and mix on low speed until combined.
Add the oats, raisins and walnuts (if using) and beat on low speed until evenly mixed. The dough will be thick and very sticky.
Cover the dough and refrigerate for 30 to 60 minutes (chill the full hour if you're worried about spreading). The dough can be chilled up to 2 days; if chilled longer than a few hours, let it sit at room temperature for at least 30 minutes before rolling.
Heat the oven to 350°F (177°C). Line two large baking sheets with parchment paper or silicone baking mats.
Roll about 2 tablespoons of dough per cookie (a cookie scoop makes the sticky dough easier) and place the balls 2 inches apart on the baking sheets.
Bake for 12 to 14 minutes, until the edges are lightly browned. The centers will look very soft and underbaked.
Let the cookies cool on the baking sheet for 5 minutes, then move them to a wire rack to cool completely. They finish setting as they cool.