Does your diagram look like the one on page 6 ?
If so pin1 on the mirror is a switched live supply. The number 9 means it goes to line 9 on the drawing which is on page 1, if you look at page 1 you will see on line 9 the matching 60 and it connects to fuse 231.
Pin 2 is an earth.
pin 3 connects to the onboard supply control unit.
pin 4 and pin 5 aren't needed unless you have the side mirrors that dim as well.
Pin 6 connects to the interior light on pin 1
If you find the connector T17f the 17-pin connector, orange, coupling station on left of A-pillar then hopefully you can tap in there for the wires that connect to pins 1 and 3
The earth you should be able to pick up on the interior light and also make the connection W for pin 6 of the mirror to pin 1 on the interior light.
Looking at the wiring diagram for the interior light it seems that this connection is related to the operation of the reading lights in the car. So all the mirrors don't dim when a reading light is turned on.
Pin 6 on the interior light a brown wire is an earth connection.
The mirror works out when it's light and dark with the sensors built in. As far as I can see the wire that goes to the module J519, the connection marked A87 is the wire used to feed the reversing light bulbs. Thats what connection RL means in the descriptrion ( Connection (RL), in dash panel wiring harness) . RL is Reversing Lights.
When you select reverse the mirrors will be undimmed.
I would look at the 17 way orange connector by the A pillar to pick up the wiring you need, probably easier than getting to the BCM as it's buried out the way. I had to make a connection to it to enable the ADS the other week.
The mirror doesn't know if the lights are on the car or not, it doesn't care.
There is a sensor that measures ambient light level so it knows when it's dark, there is a sensor that measures the light level falling on the mirror and if that is much higher than the ambient then it decides to dim the mirror because you are being dazzled. If you are in the car and going to reverse then the rear view and side mirrors don't want to be dimmed, so when ever reverse is selected they will not be dimmed.
Also when somebody turns on the reading lights this will probably fool the mirror into thinking that you are being dazzled so it would dim, also dimming the side mirrors unnecessarily.
Knowing the reading lights are on it wouldn't dim the mirrors.