This is a corrected and extended version of my earlier comment. Let $A = \{ b_1^{m_1}, \dots, b_k^{m_k}\}$ where $b_1 < \dots < b_k$ and $m_i$ are their multiplicities with $\sum_{i=1}^k m_i = n$.
Then
$$S:=\sum_{a,a'\in A\atop a\ne a'} \max(a,a') = 2\sum_{i=1}^k m_i (m_1+\dots+m_{i-1}) b_i,$$
where $2m_i (m_1+\dots+m_{i-1})$ enumerates the ordered pairs $a\ne a'$ with $\max(a,a')=b_i$.
Without further assumptions on relative values of $m_i$ and/or $b_i$, the connection to the sum of elements of $A$ equal $\sum_{i=1}^k m_ib_i$ will be rather weak, e.g.
$$\sum_{i=1}^k m_ib_i \leq \sum_{i=1}^k m_i b_k \leq \frac{\sum_{i=1}^k m_i}{2m_k\sum_{i=1}^{k-1} m_i} S = \frac{n}{2m_k(n-m_k)}S.$$
If we knew, for example, that $m_1b_1\leq \dots \leq m_kb_k$ we could use Chebyshev sum inequality giving
$$S \geq \frac2{k} \sum_{i=1}^k (m_1+\dots+m_{i-1})\cdot \sum_{i=1}^k m_ib_i.$$