Stephen Betts said: "... each extension needs to be aware of what extensions have already been used..."
Instead of what you're doing with putting variables in templates, now about making your extensions themselves more intelligent by using a static variable to log which extensions have been used?
I am currently doing something like this to prevent an extension being used more than once.
Best Regards, Aerik