All Swallowtail butterflies have osmeterium ranging in color from yellow to orange to red. They never put them out to me when i pick them up, but i am careful not to pick them up when they are shedding or otherwise indisposed. The Danaus butterflies show their displeasure by banging their heads against a trunk or branch. They don't like being watered along with a plant and i learned this by looking down and seeing a group of them all banging their heads
The communication was clear and i was more careful about getting them wet after that. When they are wet, they are more susceptible to skin diseases. Butterflies have always surprised me by their will and life force and they can be surprisingly strong. I thought perhaps the butterflies in India might have an immunity to Neem because of the thousands of years it has been used there. I don't know, just a thought. Butterflies are close to the bottom of the food chain and although they have clever ways of self protection, just about everything wants to eat them and the survival rate is quite low, so don't feel too badly if your butterfly does not survive...you will have learned something anyway. You don't need an enclosed box if you want to try to save one or two. As long as they are eating they will not leave a food source. I have raised a few in eminent danger in rather large margarita glasses, on the patio (away from predators) with a paper or cotton napkin lining for traction, very successfully. It will be clear when they want to pupate, because they will stop eating the food you provide. A nice thick stick will be appreciated. Just don't keep them enclosed. They need good air circulation.
As for your Basil problem, you might want to grow them in pots and transplant them later. If i recall correctly, Basil will transplant quite nicely (but you might want to get a 2nd opinion on that).
I hear India's one volcano on Barren Island has recently become active. I have heard it called a mud volcano and don't exactly know how they are active. Although i doubt you are close enough to be effected. I have a volcano too and all the explosions and ash have caused the butterflies to go live somewhere else. It seems strange not having them in the garden, but i remain prepared for them if/when they decide to return
.