Managed to add a few new states to the Dosbox-X based disc spinup/spindown/insert scheme.
First, the insert time is an addition of 2 timings, which are a human change speed(e seconds) and a 1 second extra time by default for retracting the tray into the drive(total 4 sec like Dosbox-X).
There's a small difference, however. UniPCemu now also counts ejects as a valid state. So that's a 1 second eject time, after which the counting simply stops. When counting or finished counting the eject time, said time will be used when retracting the drive(by the eject button on the virtual drive or start/stop load tray command). When such an event starts, it'll start the CD-ROM insertion phase of Dosbox-X. Said time is always 4 seconds on Dosbox-X, but UniPCemu now instead counts 3 seconds(slow human speed) or 0 seconds(when using the start/stop unit command). To that time, the remainder of the time not spent on ejecting the tray(in other words, the amount of seconds(up to 1, which is the tray fully ejected, 0 seconds left becoming 1 second timing added instead, currently)) is substracted from the 1 second the drive takes to eject the tray to obtain the amount of time the drive spent moving out of the drive(between 0 and up to 1 second). That time is essentially how far the tray needs to move to retract into the drive. That calculated time is added to the previously mentioned 0 or 3 seconds, to get a range of 0 to 4 seconds to retract the tray and start the spin up phase's timing.
So that's usually first 1 second to eject the tray, 3 seconds to change a disk(if human, 0 otherwise), 1 second to retract the tray and finally 1 second to spin up the spindle.
Of course there's still a 10 second timeout to spin down and become idle(following after any data accesses reading from disc, if any). And the drive can now be manually spinned down using the start/stop unit with loEj=0 to stop it manually(in 1 second time).
Mostly the ejecting mechanism(and fast(software start/stop unit)/human(currently unused) ejected timings) and status, as well as start/stop of the spindle (both taking 1 second) is now added to UniPCemu's code.
Another new thing is that the Settings menu now has CD-ROM eject (or load when ejected) buttons added, which perform the start/stop unit commands according to the sff8020i ATAPI protocol's requirements with the new timings.
So you can now properly eject the tray when software locks the drive and uses the Microsoft Removable Media Status Notification protocol extension (Which should now be properly detected).