This feature is named Code Folding. You can find the config options for it at Configuration - Editor Display - Code Folding.
According to your description at least the options Save folded lines and Enable show/hide lines and code folding are set. You can uncheck the first option which should help you.
Interesting is that I can't reproduce the effect you described with UE v12.20a+2. I have checked the 2 options and folded one block of code. Then I closed UltraEdit, restarted it, reloaded the file (block is folded), unfold it and used the vertical scroll bar. The fold is not done again automatically. I tried this procedure with both settings of option Show last line of fold in syntax highlighted files. The other 2 options were not checked.
If you can reproduce that effect please report it by email to IDM support with your XML file and a detailed description how to reproduce it so the IDM developers can fix the problem.
Best regards from Austria