"Is it worth rebuilding?" I think that's a question that only you can answer. Are you rebuilding it to sell or to ride?
If your intention is to sell the bike, the answer is simple. Start with a reasonable selling price and that determines how much money you can put into it and still break even. In this case, I'm with HillRider. Don't put too much into upgrading it because you probably won't get it back.
If your intention is to ride it yourself, the math gets fuzzier. There's upgrades to make the bike ride better in some way. There's upgrades to make the bike look cooler to your eye. There's even upgrades just because it's something that you like to do. I've done all three in my time and, looking back on it today, I think that while most didn't make economic sense, every single one was worth it to me. It's hard to set a value on fun. I doubt HillRider will understand.