The best thing to do, would be to keep the smarty logic in place in the invidual scripts and then rewrite the library so it just fetches the template and does the replaces as necessary. This is what we'll probably end up doing actually at some point, possibly with the GUI update.