In the top of a double-boiler, or in a metal bowl set over a pot of barely simmering water, melt the bittersweet and unsweetened chocolates, stirring, until smooth. Remove from the heat.
In a bowl, beat the egg yolks. In a medium, heavy saucepan, whisk together the sugar, cornstarch, and salt. Add the milk in a stream, whisking constantly. Bring the mixture to a boil, whisking constantly to keep lumps from forming. Remove from the heat.
Add 1 cup of the hot milk mixture to the yolks and whisk until smooth. Add the beaten yolk mixture to the saucepan with the hot milk and bring to a simmer over medium-low heat. Simmer, whisking constantly, until thick and smooth, about 3 minutes. Remove from the heat and whisk in the melted chocolate, butter, and vanilla. Transfer to a large bowl. Cover with plastic wrap, pressing down on the surface to prevent a skin from forming, and refrigerate to cool.
In a medium bowl, whip the cream until soft peaks start to form. Add the confectioner's sugar and continue beating until stiff peaks start to form. Fold half of the whipped cream and most of the crushed cookies into the cooled pudding mixture. Spoon into a 9-inch square glass baking dish. Sprinkle with the remaining cookies. Spoon the remaining whipped cream in blobs on the top for "ghosts" and garnish with gummy worms, slightly poking them down into the surface. Serve immediately, or refrigerate until ready to serve.
Makes 8 to 10 servings