Basically this is an endless cycle of revenge that can only permanently end with the destruction and taking of the land of one of the warring factions.
I'm not seeing Hamas winning anything in this situation, but hey, they get points for trying.
Best they're going to be able to do is increase international pressure on Israel to stop attacking them, in which case they'll be a ceasefire, 1-2 years later the rockets will start shooting across borders again and we'll be back at square one.
it's like two burly men trying to beat each other to death, except Hamas is using a pillow, and Israel is using a a 2x4, and then after getting hit multiple times with the 2x4 they call it a truce and then Hamas asks for a rematch the next day.