Scripts used for upgrade (e.g. mysql_system_tables_fix.sql) use ancient logic implemented for upgrades from very old versions, such as 3.23. It cannot stay there forever, the scripts grow complicated, and modification of them becomes error-prone. Since it is unrealistic to expect anyway, that live upgrade from such an old version would work, some clean-up is needed.
MDEV-6068 for an example of such logic.
Also they can be simplified by using compound statements.