Changing between Router and AP mode is complicated configuration. There is no script. We change all the settings in uci including network, wireless, firewall and dns. So pls do not do it manually until you do know how to do that.
If you mess up, you can reset the firmware and start again. Generally this is the cycle of learning.
Haven’t try mdns though.