Heat the oven to 350°F and line baking sheets with parchment paper. Set up the pans before shaping so the chilled dough can go straight onto a prepared surface.
Beat the butter, granulated sugar, and brown sugar for about 3 minutes, then mix in the vanilla and eggs. Scrape the bowl as needed until the mixture is creamy and uniform with no butter pockets.
Whisk the flour, baking soda, and salt for the chocolate chip dough, then fold in half of the creamed mixture with a rubber spatula. Stir in the chocolate wafers, holding back a few pieces for the tops, until the dough comes together.
Mix the remaining creamed mixture with the cocoa dough flour, cocoa powder, baking soda, salt, and optional espresso powder on low speed. Fold in the chocolate wafers, reserving a few for topping, and stop when the darker dough is evenly colored.
Use a medium 1 1/2-tablespoon cookie scoop to portion both doughs, then sandwich one cocoa portion between two torn pieces of vanilla dough, or reverse the arrangement. Roll lightly into a ball, place it on the prepared pan, and press a few reserved wafers onto the surface.
Wrap the shaped dough tightly in plastic wrap and refrigerate for at least 24 hours but no more than 72 hours. The chilled dough will feel firmer and hold a taller shape in the oven.
Bake for 11 to 13 minutes, then finish with flaky sea salt if desired and cool for 5 minutes before moving the cookies to wire racks. Look for golden-brown edges on the vanilla side; the cocoa side stays dark, so the set edges are the better doneness cue.