It is a myth that the length of the shotgun's barrel will significantly affect the shot pattern. Although there would be a noticeable difference between a sawed-off barrel and a full-length hunting barrel, the difference between a 18.5" barrel and a 28" barrel is not very noticeable IF both are cylinder bore (no choke). The choke makes 95% of the difference. A choke on a shorter barrel will produce a basically identical pattern that the same choke on a longer barrel will.
In regard to range, I'm not sure if you're talking about effective range or the actual distance that the shot will travel. A tighter choke will increase effective range because it keeps the shot within a tighter circle at that range. At a certain point, shot becomes so spread out that a target cannot reliably be hit by it beyond that range. A tighter choke will have a longer effective range, and a cylinder bore (no choke) will have the shortest effective range.
So-called law enforcement or self defense barrels feature a cylinder bore. While it is commonly thought that this is to make the shot spread wider so that a target is easier to hit, this is not the case. Rather, humans are big targets, and at the range that law enforcement or self defense encounters typically happen, no choke is required. A barrel with a cylinder bore is simply less expensive to produce, and requires less maintenance to keep it clean.
The main function of a shotgun barrel's length is to affect the swing of the weapon. In self defense scenarios, being able to instantly point the gun is important. A short barrel maintains minimal momentum, and allows the user to quickly swing the gun and then stop on their intended target. Hunting shotguns frequently have barrels of 22-28". When hunting small, fast moving targets, the shooter does not aim at the target and then stop the gun, he "swings through" the target and pulls the trigger while the gun is moving. Shorter barrels (22") are ideal for hunting rabbits in brush and flushing birds such as quail at close range. A wider choke is often used since range will be fairly short, and a wider shot pattern can increase the chances of a hit. Longer barrels (28") are usually used for birds flying overhead, where the gun will be swung more slowly. A tighter choke is often used to increase the effective range to help reach more distant targets.