Caution: wordy ramble following.
There is no special power off sequence for optical drives. The drive is not reset, no precautionary measures are put in motion (none need to be in place, really), and things remain just as if the drive was powered on.
When the tray is closed, for as long as it is closed (on or off), the disc is locked in place. The spindle motor has the disc suspended slightly above the tray, the magnetic clamp is in place, and the drive does not exit this state until the tray is next ejected.
With no disc in the tray upon closing, the spindle motor still rises as if there was a disc there, the magnetic clamp still clamps down as if a disc was there.
Ejecting the tray pulls the clamp apart from the spindle motor (and the disc, if one had been inserted), leaving the clamp suspended in the lid.
For some desktop drives, before the tray is ejected, the optics return to a “home” position & the servo controlling the optics will “beep” or “click” at this time. For other desktop drives, after the tray is ejected & reinserted, the optics will return to their home position as part of the disc check; the “beep” or “click” of the servo pushing/pulling the optics back & forth will occur then.
For slot loading drives, the disc remains suspended in the same manner & all the above still applies. Upon power up, with no disc fully inserted, the drive may do a sweep to ensure there is no disc partially inserted using the eject mechanism; if a disc is inserted far enough, the drive may suck the disc in as normal. Upon power up with a disc, the drive will just pretend as if the disc was just inserted & begin trying to ready itself for use.