Barrel length is an extremely tricky subject.
Even very short barrels can be extremely accurate, but it all depends on your setup. For the RIF to be accurate, the BB needs enough time in the barrel for its flight to stabilize. How long that is depends on weight, hop setup, nozzle setup, rate of fire (if using FA), and multiple other factors. Generally speaking, for the average AEG, maximum accuracy can be achieved at 250mm. Anything past that does not increase your accuracy. You may gain power with a longer barrel and thus increase your range, but you will not necessarily increase your accuracy.
As others have stated, a hop rubber and nub combined with heavier BBs will net you much more accuracy gain than a new barrel, but I'll add another note here: hop rubber and nub are not the first things you should change. First, before spending any money, you should stabilize your hop setup. This is achieved by wrapping your inner barrel in tape, so it sits without wiggling in the outer barrel, removing the hop spring and using o-rings, a piece of cork, or even hard rubber or foam to brace it against the gearbox, aluminum tape or even plastic shims on the hop unit "wings" to eliminate rotation, and shims on your hop arm to make it as consistent as possible.
In terms of accuracy gain by %, here's my approximate chart, from my personal experience.
35%: Heavy, high quality BBs
35%: Stabilization
20%: Hop packing and nub
10%: Barrel
I've had RIFs with dirty corroded barrels and dirty standard hop rubbers that performed amazingly, because they were naturally stabilized and I was using high quality BBs. The same cannot be said for using an amazing setup with bad stabilization and bad BBs. Even the most accurate RIF will perform horrible with crappy ammo.
I would highly recommend against spraying silicon oil up the nozzle, for the simple reason that not all of the oil will clear out of the nozzle immediately, so there's a decent chance of still having some left to get on your hop rubber. And even a tiny bit can ruin your accuracy.