Switch on your instant pot to sauté (medium heat) and add the remaining oil to the steel insert followed by the remaining onions. Fry the onions to a reddish-brown color.
Add the mince. Cook for five minutes, then add the wet masala prepared in step 3 of prep and the biryani masala powder. Cook for 10 minutes or until the oil floats to the surface.
Cancel sauté and add half a cup water to the mince. Secure the lid and make sure the steam release valve is on 'sealing.' Press the pressure cooking button (high) and set the timer to 5 minutes. When the timer beeps, release pressure after 5 minutes. Open the pot and check. If there's no liquid, you're good to go. If there is still some liquid, dry it on sauté mode again.
Put about 12 cups water to boil in a large pot on the stovetop. Add the whole spices and salt. Let it come to a roiling boil.
Add the drained rice and cook until al dente (about three-fourths cooked).
Drain the rice in a colander over the kitchen sink.
Return one-third of the rice to the pot and spread it on the bottom. Spread half the mince on top of the rice, then follow with another layer of rice, more mince and top with a final layer of rice.
Gently reheat the caramelized onions you prepared in step 2 of prep (without burning them) and pour them along with the oil on top of the rice. If using the optional ingredients, put them on top of the rice at this stage.
Sprinkle half a cup of warm water or milk on top of the rice and cover the pot with a tight-fitting lid. Put the pot on gentle heat on the stovetop and let the rice and meat cook undisturbed again for 10-12 minutes.
Turn off the heat and let the pot rest on the hob for 20-30 minutes.
Open the pot, fluff the rice with a fork taking care to turn the bottom layers too. Serve hot with the raita of your choice.