set_max_answer does this for you: it checks on page-load and it sets the click action. So you only have to call this single function.
Yes, it would be better to do this automatically via the questions admin. But I'm not planning any extra features so I won't be programming it. :)
If you think about it. How many times will the max number for a given question change? Not many times, probably not even once during the tournament. So, for now, I think this work-around should work just fine.
The div for a question is fixed for that question, so if you set the javascript for a question once the question is added to the database, then you won't have to change it anymore; the database ID remains the same.
If you're going for the javascript-only solution I suggest that you use a plugin that enables you to dynamically add javascript to your pages. That way you won't have to fiddle with the plugin code and risk losing changes in an update.
I don't know which one is best, but I tried "HTML Javascript Adder", added the widget to one of my sidebars and added the following lines in the widget:
<script type="text/javascript">
jQuery( document ).ready( function() {
set_max_answers( 1, 2 ); // question ID 1 has a max of 2
set_max_answers( 5, 4 ); // question ID 5 has a max of 4
});
</script>
That was it to maximize two of my questions.
Disclaimer: Plugin version 1.4 does not contain the needed functions. They have to be taken from the development tree. A future release (e.g. 1.4.1) will contain the changed pool.js.