From the Unofficial Doom Specs:
Line type 9 is a special one. The definitive example is the chainsaw pillar on E1M2. Take the lowest-numbered linedef that has a sidedef in the tagged sector. If that linedef is one-sided, nothing happens. If it is 2-sided, then the tagged sector's floor will move down to match the 2nd sector's floor height (or it will jump instantly up if it was below, like other floors that are supposed to move "down").
If this 2nd sector CONTAINS the tagged sector, i.e. all the linedefs with a sidedef in the tagged sector have their other sidedef in the 2nd sector, then this 2nd sector is the "donut". This donut's floor will move "up" to match the floor height of the sector on the other side of the DONUT's lowest-numbered linedef, excluding those linedefs that are shared with the "donut hole" central sector. Also, the donut will undergo a floor texture change and special sector type change to match the "outside". The donut sector does not have to be completely surrounded by another sector (i.e. it can have 1-sided linedefs), but if its lowest-numbered linedef is not 2-sided, a minor glitch results: the donut and the donut-hole both move to a strange height, and the donut changes floor texture to TLITE6_6 - the last flat in the directory.
Note that if the donut hole and the donut are both going to move, the donut hole is going to move to match the height that the donut is "going to". In other words, the whole thing will be at a single height when they're done, and this is the height of the "outside" sector that borders the donut.
In other words, you want your sectors arranged like this:
<-------- the OUTSIDE SECTOR has no tag, and its floor texture
______ and special type will be transferred to...
/ <---\---- the DONUT SECTOR, which also has no tag,
/ ____ \ and whose floor moves up too match the OUTSIDE.
| | | |
| | <-|---|-- the HOLE SECTOR is the only one that is tagged,
| |____| | and does not change texture or type, and moves down
\ / to match height with the DONUT (which will be same
\ / height as the OUTSIDE).
Note that like all linetypes that transfer sector specials, if the outside sector is secret and the donut isn't, the donut sector will become an extra secret, making more than 100% secrets possible. Similary, if the donut sector is secret but the outside is not, the donut's secret will disappear, making 100% secrets impossible unless the player already entered the donut prior to triggering it.