Find-and-replace optimization
You should be using String.prototype.replace() with a function as the second argument. Example:

str = str.replace(/{add_([A-Z]+)}/gi, function(match, id) {
  var o = Core.get_data_by_id(ex.extensions, id);   
  return (o &amp;&amp; o.status == "1") ? o.html : match;
}); 

str = str.replace(/{banner_([0-9]+)}/gi, function(match, id){
  var b = Core.get_data_by_id(ex.banners, id);

  if (b &amp;&amp; b.status =="1" &amp;&amp; b.code &amp;&amp; b.code.length) {
    var content = '&lt;div class="units-row banner_'+b.id+'"&gt;&lt;ul&gt;' +
    b.code.each(function(s){
       content += '&lt;li&gt;'+s.code+'&lt;/li&gt;';
    });                     
    content += '&lt;/ul&gt;&lt;/div&gt;';
    return content;
  } 
  return match; 
});


EDIT: I've added the second part.