I would open that gearbox and replace the gears. They will break sooner or later. Also, the piston head likes to crack too sometimes.
The first thing to change if you are after range - not maximum range but the range where you can hit someone - are BBs. Use the best quality and heavy BBs. For aegs 0.28 or 0.30. Use the heaviest one your gun can handle.
Fix the hopup unit and the barrel in place. You can put a rubber patch on the hopup unit to push it into the gearbox. This fixes most of that crappy m4 hopup's problem, except if it likes to loose the setting. If it is then change it to pro-win or a copy of that.
Then find a rubber that your barrel, nozzle, and hopup likes. There is no best one here. One can work for someone, and doesn't in an other setup. There are good ones though you can choose from. Maple leaf, madbull, modify, etc.