Preheat oven to 350F. Line an 8-by-8-inch baking pan with aluminum foil, spray with cooking spray; set aside.
In a large microwave-safe bowl, melt the butter, about 1 minute. Allow the butter to cool momentarily so you don’t scramble the egg. Add the egg, sugars, vanilla, and stir vigorously to combine, for about 1 minute. Add the flour, baking soda, optional salt and stir until just incorporated. Batter will be quite thick.
Reserve 1/2 cup batter; set aside. Turn remaining batter out into prepared pan, smoothing it lightly with a spatula. Evenly sprinkle the peanut butter cups over the batter. Pour sweetened condensed milk over the top. Using your fingers, lightly crumble the reserved cookie dough over the top in irregular, marble-sized chunks.
Bake for about 30 minutes, or until a toothpick inserted into the center comes out without cookie dough batter clinging; it may not be clean because you’re going through other layers and you may have to peck around to find a testing place. Edges will be firm and golden. The sweetened condensed milk should nearly be set in all places, and possibly only a little jiggly in the very center of the pan. Bars will firm up more in pan as they cool.
Allow bars to cool in pan for at least 3 hours before slicing and serving. Expediting this by placing pan in the refrigerator is okay if you’re in a hurry. Extra bars will keep airtight at room temperature for up to 1 week, or in the freezer for up to 3 months.
Bars may be kept gluten-free by replacing the flour with your favorite gluten-free baking blend. Take care any ingredients used are suitable for your dietary needs.