Let me point out that editing header.php or any core files is unsupported and violates the support terms. Please remove that code from the file as it will cause problems now and later.

To add PHP code to the branding area, as Batman correctly points out, you need to use a hook.

We have a free plugin called "Action Map" which will help you find the proper hook to use. Then, we also have a product called "Hooker" that will allow you to paste your code (once you know which hook to select). It creates the code for you, so that you don't have to do more than look, select and paste. Once saved, the hook is done and your shortcode will be functional where you want it. Positioning it precisely is simply a matter of CSS.