Scripting the deployment of service applications is a good idea; it is predictable, repeatable and gets you control over database names. I found a good script for the Metadata Service Application at Zach Rosenfield’s blog post SP+PS 2010: PowerShell to Create a Service Application. Read Zach’s blog post for a detailed description of the script.
Here is the script, adjusted with RTM changes: