Yes, longer barrels increase the accuracy. Although, there are many other factors as well which determine the accuracy of the gun such as wind-resistance, bullet shape and bullet mass. However, the length of the barrel contributes greatly to the accuracy of the marker.
A longer barrel allows the propelled object (i.e: paintball) to become more stable, which increases accuracy.