For scripting, it would be nice if there was a way for sdwire switch command to not exit until the switch has completed. It seems like the switch from target to host mode can take 2-3 seconds on my system but sdwire switch returns in well under 1 second.
In this case, I'm considering the switch from target to host mode complete when the SD card device shows up on my host.
Having the switch wait until the device shows up on the host (or disappears from the host completely) would help with scripting use-cases so that doing sleep X isn't needed nor external checking for device showing up / going away.