When you apply settings to wireless interface, all wireless connections are disconnected and reconected, somewhat like a radio reset. So remote connection is lost.
Also, if what you have changed is the security profile, radio link won't be restablished until you've set the same sec. profile in both ends.
You should start radio settings from the most far peer. If you start changing settings from the nearest peer, you'll "lose" the remote node and you could not connect to it.
What I use for these cases when connectivity can be easily lost, is a small autorecover script. I make a backup (working_backup) before changing anything. Then I create a script (/system backup load=working_bacup) that restore the backup done before, and using scheduler I run "/system script run recover" with a time interval of 15 minutes.
This gives me 15 minutes to change configuration, and the safety that if something goes wrong, in 15minutes all changes will be destroyed. If I finish configuration correctly, I disable the scheduler rule.
Hope it will help!