Add to that hazard perception, and any issues with the PTI that may cause problems for alighting passengers on the train and those already on the platform
Of course. Ensure the train is fully accommodated in the platform in the correct position. Ensure it is safe to release the doors. We were told for example if there is a fight on the platform or something, not to release the doors. In theory the driver would see the fight while pulling in and signal 2-2 (do not release doors). In theory they should signal the same if they have overran the platform - but again the guard should check before releasing the doors.
A few weeks ago we were held outside a station and the driver called saying the signaller had held us due to an intoxicated passenger trying to board a previous train at the next station, so not to release the doors until I am certain he isn't trying to board. Police had him detained when I checked so I then released the doors.
The guard should also know who requires assistance - for example if you see somebody struggling with a pram, case or somebody with poor mobility struggling with the gap, it is best to assist them to avoid a slip, trip, fall down the gap etc. If the guard is keeping an eye on the train internally throughout the journey its easy enough to identify those who might need extra help alighting through ticket checks etc and to position yourself in a suitable position for their station to assist them.
Where I work we don't have dwell time targets as such, we are told to take as much time as we need to ensure the safety of PTI and not to rush. It takes as long as it takes to perform the PTI safety checks, let everybody board and alight, and to assist those who need assistance.
Obviously its quite difficult to judge how long is long enough, but rushing through the process to meet a target surely increases the chances of an incident such as overcarrying a passenger, or trapping somebody in the doors.