No such thing as Master and Slave now with SATA drives and is also
meaningless on external drives connected through USB anyway.
When you reconnect the Ubuntu drive two things will happen, 1) Windows
will ignore it 2) Ubuntu will add Windows to the boot menu if you boot
with the external drive attached and run sudo update-grub.
What you will need to do is use the 'Select Boot Device' key on boot
up to choose whether you want the internal drive with Ubuntu or the
USB drive with Windows. Often this is [F12] but my system uses [F11]
and I've seen [F8] used for this too ( really silly as it interferes
with the boot into Safe Mode in Windows ! ).
If the motherboard doesn't have this option ( and it even may need to
be turned on in BIOS ) then you'll have to manually select the boot
drive in BIOS each time - hope not as this would be a pain