I thought killing Data off in NEM was a patent rip-off of killing Spock in TWoK. Minus any emotion associated with it. How convenient that they just found an android who looks just like Data!
It's an unfortunate misconception that B-4 was only introduced to allow Data a way to come back to life. He was actually put into the story to parallel the Picard/Shinzon relationship, and an essential part of the story was establishing that B-4 couldn't grow into a being like Data, that he lacked the capacity for growth and learning that Data had, and that was what made him a flawed reflection just as Shinzon's inability to let himself grow made him a flawed reflection of Picard. Throughout the movie, it was driven home that B-4 was just too limited, that all Data's attempts to download memories into him or make him smarter just plain didn't work. The ending where B-4 sang the song wasn't really meant to say "Hey, Data will be resurrected, no problem," but merely to suggest that maybe some small bit of Data's efforts had rubbed off on B-4 and he'd be able to grow at least a little bit, serving as Data's legacy. But it didn't really work as it was intended to, because just about everyone sees it as something that was only done as a back door for resurrecting Data. And that's because they remember what happened in TWOK/TSFS.
Except that the bit at the end of TWOK about Spock not really being dead so long as we remember him, and the final shot of the torpedo tube on the surface, wasn't really intended as a way of bringing him back either. It was just something the filmmakers added as an afterthought when test audiences found the ending too depressing. It was just meant to give the ending a more hopeful tone, as was the ending of NEM. It wasn't until later, when they were planning TSFS, that they decided to build on the potential implicit in TWOK's ending.
At the time I don't think I saw the ending of TWoK as an attempt to set things up to bring Spock back, though for those who go in knowing how things will turn out I could understand why it would seem that way. I do think it was and is one of the best examples of how to kill a primary character in a movie franchise though. Its power even after repeated viewings is largely undiminished IMO. Even knowing Spock will come back doesn't really lessen the impact, because the TOS crew have to make serious sacrifices to get to that point.
I don't feel the Data-B4 dynamic successfully mirrored the Picard-Shinzon dynamic, largely because while Shinzon is unable to overcome his shortcomings in the end, it's a choice on his part (and I have to admit if I hadn't seen Tom Hardy in other films I might have ended up grossly underestimating his acting chops). B4 has no such choice; he's a victim of his design/programming. If the goal wasn't to make us think that B4 might "become" Data to some degree, then I think having B4 sing the song was a misstep, and one glaring enough that it shouldn't have made it to final script. It may be a misconception that B4 was a set-up as a Data successor, but I can't blame anyone for drawing that conclusion based on the evidence, and it's complicated by the significant and generally unfortunate similarities between NEM and TWoK. I don't think I actively thought B4 would become Data II (in fact I don't think Data would have downloaded his memories if he believed that was a likely outcome), but it still cheapened Dats's death to have even a partial copy available.
I don't quite know how Dats's death could have been handled with more resonance, but I know that as portrayed I find it sorely lacking. Lal's death gets to me, even Lore's death I find somewhat sad (could Lore have ever overcome his deficiencies? We'll never know...). Data's death...not so much. Much like the destruction of the E-D in GEN I suppose, there's too many contrivances put into place to generate the desired outcome as well.