if you don't like how the formatter laid out your code, you may need to introduce new functions/variables the formatter is not as clever as humans are, so it can sometimes produce less readable code ...
This repository can be added as an extension in MakeCode. This image shows the blocks code from the last commit in master. This image may take a few minutes to refresh.