Hi Jean-Michel,
You are correct, my suggested hack did not take into account the "multiple tries behaviour". I have tested your matchset question type and it seems to work fine. Congratulations!
However, I persist in thinking that "all-or-nothing" should really be made an option of the core Matching question. Whenever a new function/option is requested for an existing question type, it has to be decided whether a) it's a minor but useful function that should be part of the original question type or b) it is a major change and deserves a new question type to be created. For me, this "all-or-nothing" option clearly belongs to the first case. Since Tim seems to agree and you are very knowledgeable in the question code, would you agree to implement the change in a way that would be agreeable to Tim?
Joseph