Every problem with a number for an answer can be solved with math.
To lay down some base information I used in my calculations:
The average xp per minute is 1950.
The math to determine this is based on a 50% chance of loss each round.
Average exp per minute = (1000 * 0.5) + (2000 * 0.25) + (3000 * 0.12) + (4000 *.06) + (5000 0.07)
To be exact if you want, every minute of game play you gain 1950 exp and 97.5 gold
At this rate level 31 takes exactly 76 hours for a 1st generation player.
So... it takes 76 hours of work to obtain an heirloom, but that is not the end of the story. During that time your character produces 444,620 gold. Formula:
Heirloom_Times * (76 hours of work + 444,620 gold) + Original_item_cost = Cost_of_Heirloom
to reduce further, 76 hours also equates to 444,620 gold so
Heirloom_Times * (889,240 gold) + Original_item_cost = Cost_of_heirloom
The first time you heirloom an item it is worth to you 889,240 gold
The second is 862,562 gold
The third is 835,886 gold
So triple heir-loomed item is theoretically worth +2,587688 gold
But by observation it is clear that players value not going without armor and weapon for 76 hours at over 444,620 gold. Because of this it can be excluded from the calculations by an opportunity cost that renders it irrelevant. So really, the actual value is half of this, making the final values calculated to be: (rounded)
1x Loom += 445,000 gold
2x Loom += 876,000 gold
3x Loom += 1,294,000 gold
----------------------------------------------------------------
P.S. : These final values are simply the value of obtaining them yourselves. If people are not willing to pay this amount for your items then in general it is not worth the money to sell your heirlooms. (unless the heirloom is worthless to you like an Elders Training Sword)