For the if True section.
This code is saving into the network-wide “host” option the value of the posted host-url argument from the settings page.
For the else section of code.
the register_setting() is registering for the option-group ‘my_settings’ on the settings page it would need to have add_settings_section() and add_settings_field() to become part of the rendered settings page. So it doesn’t make sense since the settings is most likely to already be on the page.