I doubt that automating this will produce good results.
I consider Replace Color unfit for professional work and Match Color of fairly little use in general.
Have you been able to produce Action Manager code for the two operations with ScriptingListener.plugin?
Could you please post examplary image pair/s and the results you want to achieve?
Basically I think fully automating this task is not achieveable with satisfactory results at current.
Recoloring black items is usually a bad idea to begin with (for example because of the fringe issue and having to create color content from a limited luminance range).
Also the Selection of the region would almost cerainly take a lot of manual intervention.
Edit: With »fringe issue« I mean the sometime necessity to decontaminate both foreground (in this case the shirt) and background (the grey background but also the jeans and regions of skin and hair that touch the shirt) to avoid irritating effects along the edge if the mask has any softness.