Fleshed out metabox creation function to show box only when required.