Lonest barrel length isnt really thd right question go ask. There are alot of different gearbox setups. The thing that youll have to first look at is the location of the port on the cylender. This will dictate how long of a barrel the gun can use effectively a port closer to the frontbof the cylender can only use shorter barrels while a full cylender (no port. Like on an ak47 fro example) can use longer barrels. Going to a bore up kit increases the volume of the cylender more and thus allows use of longer barrels still. All that said i find 455 to be optimum so long as the cylender has the correct volume to use it. (most of the china made m4's these days have s port 4/5 down the cylender that allows up to 460mm and most of my gjns have this. My ak has no port or a full cylender and also performs well with a 455.
Keep in mind the longer the barrel the longer the gun and it wont always make your gun shoot further or more accurately. The key to that is going to be a good quality barrel and hop up rubber. My mp5k (with a 120mm shoots almost as well as my m4 with a 455 they both have the same hop up rubber and bucking but the mp5k lacks a lil because it uses the stock barrel while the m4 has a madbull python barrel.
I think the other questions have been answered.
Welcome to ASC here is a link about cylender vs barrel length