Queue click dynamically updating 2 models?

Rob, could you give me a rough idea of how to set up this snippet please? I’m happy to hack away at some JS, but I’m not certain how to set up the code wrappers/callbacks,  and so on…

Is there a guide or help-file somewhere, or a sample bit of JS I can modify?

Many thanks.

Brad