This is a very good point and I agree with you that the current algorithm might be too simplistic. I think a good first step would be to make the post factor nonlinear like
SUM(...) / SQRT(5 + COUNT(DISTINCT p.id))::float AS score
or maybe even
LN(1 + SUM(CASE ... END)) / (5 + COUNT(DISTINCT p.id))::float AS score