Confidence value for face recognition
If I had to calculate such a function, I would:

Calculate the probability (not Z-score) for $x$ in a two-tailed test (https://en.wikipedia.org/wiki/One-_and_two-tailed_tests) for the probability that $x$ belongs to the distribution for both distributions. Then you have $p_s(x)$ and $p_c(x)$ for self-match/cross-match. Don't use probability $0.1\%$ to reject, but to compare.

Then calculate $$\frac{p_s(x)}{p_s(x) + p_c(x)}$$

Which tends to $1$ if $p_s(x)$ is the larger term, is $0.5$ if they are the same, and tends to $0$ if $p_c(x)$ is the larger term.

At the far tails, $p_s(x)$ and $p_c(x)$ both tend to zero, but the order of magnitude will select the good probability.