placing the door at the edge is easy, since the generator knows which side the room is on.
so, regarding door codes, would this work?
archway = F
open, locked, and trapped doors = DT, DB, DL, DR
secret doors = DST, DSB, DSL, DSR
porticullises = DPT, DPB, DPL, DPR
that's what i've implemented for now (generate a dungeon, click on the 'Map TSV' button to download), let me know if anything needs to change.