Yes, there is certainly a lot of room for compacting the code. However, for complex programs such as this one, I like to use the SUB feature because it clearly circumscribes the function of the routine as well as its required parameters, plus it gives me the freedom to use local variables that will not be shared with the main program. You are absolutely correct in the fact that several of the SUB's could be converted to regular subroutines, but at the cost of clarity, at least for me. Perhaps it's an unconscious need for me to inject structure into an otherwise chaotic XB environment
As for that repetitive code section you mentioned, I have definitely given it a lot of thought during the development of the program, and while it is of course possible to compact it, this would also have introduced a lot of convolutions since each section is not exactly the same, so here again I opted for clarity.