I think we need an add on to allow JavaScript.
If that can be applied to selected pages, then you suggestion will work. If the add on applies to the whole wiki, then it's not really in the wiki sprit to have all the pages locked.
The ideal would be for only admin (for admin, read Tony as he's the only one with the ability to do it) to be able to add the script, which, I think is what the link I posted above is suggesting.
Wish I knew more to be able to progress things!