For the message key missing errors:
https://openacs.org/faq/one-faq?faq_id=130897#198980
As to mixing ns_puts, etc... You can use some of the API, but anything that involves display shouldn't be mixed with the templating system, as far as I know.
You can make a .tcl file, and use it there. It will work, but just don't use the templating system with it.