Why would Troopers need a melee weapon? You don't need a melee weapon to tank. You could be a ranged tank. Think outside the box here. This is Star Wars, most foes attack at range with a gun. You could have threat-causing abilities and take all the hits from a foe at range. Think like tanking a turret or a guard droid. Tanks don't have to melee. Now why do you think you HAVE to give a Trooper a melee weapon to tank?
"Sir,we are beginning our search for these rumored 'underwater villages'.They will not stay hidden for long". -Battle Droid Commander OOM-9!