Hi,
I suggest you to use the method I've explained
here to load the
templates function already present in ckeditor.
Follow that steps, create the plugin and the files .js that contains the templates you want to use; examples are in default.js files in /clientscript/ckeditor/plugins/templates/templates/ dir
Ask if you need help
thomas
--
mmm reading the problem again, it seems that my solution is too far from what you ask
I'm not a js expert, I cannot help you as well