What are you having problems understanding, specifically? This reads door data from an area file that (presumably, I'm just going by the code provided) would look similar to this, in an area:
0 isn't accounted for 1 is EX_ISDOOR 2 is DOOR + PICKPROOF 3 is DOOR + NOPASS 4 is DOOR + PICKPROOF + NOPASS
Presumably you'd add cases for whatever combinations you wanted to add on. If you didn't care about backwyrd compactability, you could change them to use actual bit values to make things simpler, but if you're using ROM you probably do care.
Could change the door flags to use bit 4 to 32. (8, 16, 32, etc) That way old area files will still load, and new files will be expected to use the bit value.