Is Bircat Shehechiyanu a bircat shevach (a blessing of praise)? If it is, why sometimes do we make the beracha before the event (or in some cases an action representing an event, such as putting up a mezuza), unlike all other berachot shevach, which we make afterwards?
Shehechiyuanu is a brikat hashevach.
Now I have to explain to you how every instance of shehechiyanu is really recited after the occasion.
On seeing a friend after 30 days or hearing good news that benefits only myself (I include here one who heard of rain after a drought): I think we all agree these are after.
On acquiring new property: The shulchan aruch 223:3 uses the past tense verb ("one who bought") to describe the obligation, implying it is done after the acquisition. Note that this category includes shehechiyanu on new clothes. He rules in 223:4 that the obligation starts at the time of the kinyan not the time of wearing, so despite our custom to delay the blessing to later, the obligation fundamentally set in earlier after the kinyan.
On new fruit: The shulchan aruch rules in 225:3 that one makes a shehechiyanu upon seeing a new fruit, even in someone's hand or on the tree. So despite our minhag (which he notes) to delay the bracha until eating, the obligation sets in after seeing the fruit.
On holidays: The shehechiyanu on holidays is usually recited towards the beginning of the holiday on kiddush but the gemara in Eruvin 40b makes it clear that the bracha can be recited at any point even standing alone in the market. Clearly this bracha is on the day, not the "entering" of the day and can be recited at any point after the day starts.
On mitzvot: So this is the tricky one. We have many mitzvot listed explicitly in the gemara as having shehechiyanu before doing the mitzva, but after the birkat hamitzva (megillah, ner chanuka, pidyon haben and more). I'd like to suggest that the bracha here is not on having done a rare mitzva, but upon having the opportunity to do it. As such, the perfect time for the bracha is just before doing the mitzva which is when you are most completely in position to do it. (This may also explain why it is after the birkat hamitzva the saying of which has finally allowed you to perform the mitzva.) Again, my understanding on this one, but I think it works pretty well.
Edit: I found this article which you might find useful.