this is a pretty handy post on the subject.

To condense the info to answer your question, here are the relevant things to consider for scoring:

1) Rarity

2) level

3) merges

4) BST

5) sp total.

1, 2, and 3 are pretty obvious, so I'll skip over to 4 and 5.

The BST used in the formula for scoring is the completely vanilla stat total of the unit, so completely disregarding weapons, skills, summoner support and yes merges. The formula only considers the BST in bins of 5 (so 0-5, 6-10, etc), so a unit with 169 BST will weigh the same amount as a unit with 165 BST, while a unit with 170 BST will weigh a little more than the previous two for being in a higher bin. This can come into play when some characters have banes that drop by -4 instead of the usual -3. You would want to avoid a bane in that stat if the extra -1 in net BST drops that unit into a lower bin. Or the other way around for some units that have a boon of +4 instead of the usual +3.

Stat totals are in bins of 100 (so 0-100, 101-200, etc.) so you want to cram in as many high cost skills as you can. Seals are worth the same as their existing skill (eg: Savage Blow 3 seal is worth the same as the Savage Blow 3 C slot skill).

e: I got some clarification on weapon refinery. Upgraded normal weapons cost 350sp compared to 300sp for their unrefined counterparts (eg: slaying axe++ vs slaying axe+). Prf weapons still only cost 400sp, so no boost there. So pretty much exactly what it cost in the menu pretty much lol. Also side note, seasonal blessings (like Fjorm's water blessing) doesn't affect score at all.