Some comments about your code.
Code:
$globaltemplates = array_merge( $globaltemplates, array( 'STANDARD_BETTER_ERROR') );
This is inefficient, instead use:
Code:
$globaltemplates[] = 'STANDARD_BETTER_ERROR';
array_merge should only be used if you are listing more than 1 template really
===
===
Also, I would really recommend just overriding the STANDARD_ERROR template with the customized one. Why add code when it can be done with a single template edit?