if i had time to verify everything, i would use what i am posting here to update the general hacking information thread....  :/  sorry about that!
here is the similar code for metal doors, although i can see already bad working practices in it!! (oh how i have learnt so much since!)
_DESC5:
LINE$(10)="METAL DOOR       "
OPTION(11)=True
OPTION(12)=True
OPTION(13)=True
OPTION(14)=True
   If BB mod 4=0 or BB mod 4=1
       LINE$(11)="REGULAR        "
Else If BB mod 4=2 or BB mod 4=3
       LINE$(11)="PORTCULLIS     "
End If 
     If BB mod 2=0
       LINE$(13)="OPEN          "
Else If BB mod 2=1
       LINE$(13)="CLOSED        "
End If 
     If(BB=>0 and BB<=3) or(BB=>8 and BB<=11)
      LINE$(12)="NORTH / SOUTH  "
Else If(BB=>4 and BB<=7) or(BB=>12 and BB<=15)
      LINE$(12)="EAST / WEST    "
End If 
     If CC mod 4=1
        LINE$(14)="LOCKED"
        LOCKED=1
        OPTION(15)=True
Else If AA=0
        LINE$(14)="UNLOCKED"
        LINE$(15)=""
        LOCKED=0
Else If AA>0 and(CC mod 4<>1)
        LINE$(14)="TRICK LOCK"
        OPTION(15)=True
End If 
       If AA=0 and LOCKED=1 : LINE$(15)="MAGELOCKED"
   Else If AA=1 : LINE$(15)="BRONZE LOCK"
   Else If AA=2 : LINE$(15)="IRON LOCK"
   Else If AA=3 : LINE$(15)="SERPENT LOCK"
   Else If AA=4 : LINE$(15)="CHAOS LOCK"
   Else If AA=5 : LINE$(15)="DRAGON LOCK"
   Else If AA=6 : LINE$(15)="MOON LOCK"
   Else If AA=7 : LINE$(15)="CHROMATIC LOCK"
  Else If AA>=8 : LINE$(15)="INVALID LOCK"
   End If 
If BB>=8
      LINE$(14)="LOCKED"
      LINE$(15)="VOID LOCK"
      OPTION(15)=True
End If 
Return 
i have now seen (been reminded!) that of the two bytes for each map-date piece, it's broken down as 
AA BB CC DD
with DD as the 'type' (i.e. 0-7) and AA BB being the main parameters for each type.
with this, it seems that CC (like with many types) is used to define if the door is locked, and if there is any occupancy in that space (e.g. objects, people, spells)
For example, some of this works as follows;
for BB  
 
Bytes: % 3210 
Byte 0 = open / close
Byte 1 =  regular metal / portcullis
byte 2 = north&south facing / east&west facing
byte 3 = black-locked
with AA this define what type of lock is used 
if AA = 0 (and regular lock type from CC) , door is magelocked
AA=0 -> 7  = bronze, iron, serpent, chaos, dragon, moon, chromatic... all else invalid locks.