I recently built a customisation for SugarCRM that required a custom footer on the metadata definition file.
This was a requirement, so that the final user was not able to edit the panel from Studio, and potentially damage the javascript intensive customisation.
To build the customisation as upgrade safe as possible, I created a custom view for the module I was customising, and inside the “display()” method, I set my own custom footer in the following way:
$this->ev->defs['templateMeta']['form']['footerTpl'] = 'custom/modules/Opportunities/mycustomfooter.tpl';
Then I coded all my business logic inside the display method and at the end, I called the “parent::display()” method.