Combine 1/2 cup sugar and 2 cups milk; heat until it's just about to boil.
While the milk/sugar is heating, combine the remaining ingredients (egg yolks, sugar, 1/4 c flour, cocoa, salt, 1/4 c milk) EXCEPT for butter and vanilla in a blender or mixer on low.
The goal is to mix it absolutely smoothly without lumps, not add a bunch of air to it.
Combine the two mixes and return to the saucepan.
Adjust the heat to medium high and bring to a boil for five minutes, stirring constantly until thickened.
(NOTE: It never takes me five minutes to get to this point.
).
Remove from heat; immediately stir in 2 Tablespoons butter or margarine and 1 teaspoon vanilla.
Pour into (cooked) pie crust or pudding dishes and refrigerate.
Note: if you're using this for a pie, a beautiful meringue can easily be made with the three egg whites you'll have left over from this recipe.
I'd suggest looking up #28458 and referring to those directions for how to create it -- remember to leave your crust with about ten minutes left to bake so that you don't burn it while toasting the meringue.