That sounds reasonable. I'll do an update something like that sometime this week.
Your point on listing the value before the test is exactly why it is in that order. If it is set to a value and it is wrong, having it listed prior that test may help with the troubleshooting. In addition, if it is not actually set then tat will give you a different area to troubleshoot.
I half agree, the last 2 lines can be moved, although they also need to be surounded by a Debug level. However, the path to dnf5 is important if it fails to find dnf5, and so should not be after that test. However, and additional point is all these lines should not be seen unless you have debugging enabled, so what are you looking for?
Preparation for release 7.14
Add missing flag for Output_Generated in one block
Add missing flag for Output_Generated in one block
Add missing flag for Output_Generated
Sort disk usage in human order