in Cardinal's Sins (e.g. door 3653, lever 4120)? that's using stock T2 scripts from miss7.osm: the lever is CD'd to a Marker with DoorTranslator, which in turn is CD'd to the door with TrapDoorLock. those two scripts together convert any TurnOn/TurnOff into a lock/unlock action.
but you can achieve the same effect with just default gen scripts: instead of locking the door directly, create a FnordLock, and add a Lock link from the door to it. and have the lever CD'd to the FnordLock.
Code:
Door --Lock--> FnordLock <--ControlDevice-- Lever
Note that this way you set Engine Features>Is Locked on the FnordLock, not on the door itself.