That was actually right out of the movie's sequel setup (despite the lack of a sequel). Data downloaded his entire memory, knowledge, and experience into B4 hoping it would jump start his underdeveloped brain. After he died, when Picard was trying to explain to B4 what happened to Data, B4 started singing part of a song Data had been singing at the start of the film.
After the events of the film, Data's plan eventually worked, he jump started B4's brain and took over his body. Somehow, despite the Soong Foundation turning from a scientific organization into a civil rights group for artificial life forms, nobody had the slightest ethical problem with Data erasing his brother and stealing his body.
Data set himself up for the same return that Spock did by mind melding with McCoy just before throwing himself down the warp core. Star Trek loves killing characters, but its loathe to actually let them go. Even the one that didn't leave death's door open behind her managed to return through a time traveling half Romulan baby.