Does the undecidability of the halting problem require Turing Machines to be enumerable?
No, being able to enumerate Turing machines is not directly relevant.

Let us consider some abstract notion of algorithm. The ingredients for the undecidability are as follows:


The Halting problem makes sense. This means that

a) Algorithms can "halt" on some inputs, and fail to "halt" on others. Halting allows the algorithm to output something, eg "Yes" and "No".

b) Algorithms can take algorithms as input.
Algorithms allow if-then-else branching
There is an algorithm that takes an algorithm as input, and simulates how the input-algorithm would act.


The code snippet in the question is essentially how you do it, and the criteria above are essentially saying "this code snippet is valid pseudoc-code for our abstract notion of algorithm".

To see that the fact that TMs can be enumerated really does not factor in, one can look at models of computation such as the BSS-machines. These can have arbitary real numbers as parameters in the code, so there are uncountably many machines. However, they still meet all criteria above, and thus the standard argument shows that BSS-machines cannot decide the BSS-Halting problem.