At first sight, I agree with your 'brilliant' proposal although I am not sure that the calculated code is so brilliant.
i.e. the link between the questions category and the datasets category is not clear as the moving question code does not handle moving datasets category well.
I will look next week at this after setting the numerical question proposal.
At first sigth, I need to propose modifications to datasetdefinitions_form.php that handle well selecting among datasets with the same name in the same category with the added feature of the questions using them.
So this will simplify the move_question_category datases handling.
Once this set correctly, we can then look at the case that there can be synchronized calculated coming from different categories in a same quiz.
I know from the brilliant code that Jamie has done on the moodleform that he is doing a very good job.
Is there a way that we could synchronize with the work done for OU as these "private" requirements have a direct influence on the "open" Moodle code ?