Heat-treat the flour: Spread flour on a parchment-lined baking sheet. Bake at 300°F (150°C) for 7–10 minutes, stirring once, until it reaches 165°F.
Let cool completely. Alternatively, microwave in 30-second bursts, stirring, until 165°F. Break up any clumps.
Prepare the pan: Line an 8x8-inch pan with parchment, leaving overhang on two sides to lift out later.
Cream the butter and sugars: In a bowl, beat softened butter, brown sugar, and granulated sugar until light and creamy, about 2 minutes.
Add vanilla and salt: Mix in vanilla and salt until smooth.
Mix in the flour: Add cooled, heat-treated flour.
Beat on low until mostly combined. The mixture will look crumbly.
Add milk to bind: Add 3 tablespoons milk and mix. If it still seems dry, add up to 1 more tablespoon until the dough is soft and spreadable but not sticky.
Fold in M&Ms: Stir in mini M&Ms.
Save a small handful for the top.
Press into pan: Transfer dough to the prepared pan. Press evenly with a spatula or your fingers. Sprinkle extra M&Ms on top and gently press them in.
Optional chocolate layer: Melt chocolate chips with coconut oil or butter in the microwave in 20–30 second bursts, stirring until smooth.
Spread over the dough. Add a few more M&Ms on top if you’d like.
Chill: Refrigerate for 1–2 hours, or until firm enough to slice cleanly.
Slice and serve: Lift out using the parchment. Cut into 16 squares.
For neat edges, warm a knife under hot water, wipe dry, and slice.