Does anyone know how the heap worked in SCI1.1 and the other SCI versions where the heap part of the scripts was a separate resource?
Heap resource goes on the heap, script resource goes in the hunk. This means in principle a script file can be up to 64K; the heap resource must satisfy the same constraints as before. The purpose is simple, to save some heap memory! The heap lives in the data segment of the interpreter program, which is why the total heap size is never 64K (as it could be in theory). The total free hunk still limits the total number of scripts, and the hunk is shared with all resource types except HEP; however, the hunk is garbage-collected, so running out of hunk memory is not (always) a show stopper.
In ScummVM, every SCR+HEP file _combined_ must be less than 64K, but there is otherwise no limitation on the number of scripts you can have loaded. Because we don't have a heap as such, we return dummy values in the MemoryInfo call which are carefully chosen to avoid "Memory fragmented" or similar warnings from the game code.