Let $L$ be a fixed branch -- that is, an irreducible germ of curve -- on a normal surface singularity $X$. If $A,B$ are two other branches, define $u_L(A,B) := \dfrac{(L \cdot A) \: (L \cdot B)}{A \cdot B}$, where $A \cdot B$ denotes the intersection number of $A$ and $B$. Call $X$ arborescent if all the dual graphs of its resolutions are trees. In a previous paper, the first three authors extended a 1985 theorem of P{\l}oski by proving that whenever $X$ is arborescent, the function $u_L$ is an ultrametric on the set of branches on $X$ different from $L$. In the present paper we prove that, conversely, if $u_L$ is an ultrametric, then $X$ is arborescent. We also show that for any normal surface singularity, one may find arbitrarily large sets of branches on $X$, characterized uniquely in terms of the topology of the resolutions of their sum, in restriction to which $u_L$ is still an ultrametric. Moreover, we describe the associated tree in terms of the dual graphs of such resolutions. Then we extend our setting by allowing $L$ to be an arbitrary semivaluation on $X$ and by defining $u_L$ on a suitable space of semivaluations. We prove that any such function is again an ultrametric if and only if $X$ is arborescent, and without any restriction on $X$ we exhibit special subspaces of the space of semivaluations in restriction to which $u_L$ is still an ultrametric., Comment: 50 pages, 14 figures. Final version