The HeadHtml webpart has a field called "HTMLCode" and the get method in that CS pulls what developer would type in when the webpart is dropped into a template.
In your case, you are populating the HTML in code behind, so you can add the above code into your custom web part. Then build the HTML for the meta into a string (e.g. myHTMLHeader). Then you can populate it in this line.