As a tip, you can always go into the train.dat file and change how the doors operate on the trainset itself. It's different from what your asking, but I'm just making this aware in case you feel like fiddling with that too.
http://trainsimframework.org/develop/train_train_dat.html#Go to the devices section on the page linked.
#DEVICE
1
0
1
0
0
2
0
1
2 <--- Open mode (0: The doors are opened automatically, but can also be prematurely opened manually. This is the default. 1: The doors are opened automatically. Manual override is not possible. 2: The doors can only be opened manually.)
2 <--- Close mode (0: The doors are closed automatically, but can also be prematurely closed manually. This is the default. 1: The doors are closed automatically. Manual override is not possible. 2: The doors can only be closed manually.)
You can open the .dat file with Notepad.