For truly small streams I have used a 6'6" rod for a long time. If you are saying 'bigger rivers' I'm am taking this literally and I would not understand why you would not get a full 9' or even 9'6" rod. Please don't misunderstand my meaning here, if you currently owned an 8' 6" rod I would never suggest that an extra 6" of rod was going to make a big difference in your casting but when going from a 7'6" rod and wanting something for big waters move up a foot and a half, go to the '9'.
I understand that a long rod can be an encumbrance back on a tight little stream and for that it sounds like you simply need to work on your casting technique for casting nymphs with your 4 weight. Unless you are trying to sling something really heavy a #4 rod should be able to present a nymph very well in close quarters.
The roll cast is a matter of timing and technique. In order to get almost any fly rod to execute the roll cast well you must simply get the timing down so that once you draw the line into position for the cast you do not hesitate too long before making the forward sweep with the rod. If you are hesitating too long the fly and leader are sinking and the light #4 line does not have the gusto to rip it back to the surface and propel it to the target. This scenario (the sinking fly / leader and maybe even a couple foot of your fly line) are exactly where the timing becomes crucial. You must be practiced enough that when you are using this cast when fishing there is one smooth movement as you draw in the line and then propel it toward the target area. If a person has a bad style at the roll cast a longer rod will help to camouflage it because of the added loading power of the additional graphite shaft and the extra energy that it provides. However, in the end you will continue to have problems until you work the bugs out of the cast.
Other than hands on practice perhaps doing some web searching and looking for videos on the roll cast and the single hand Spey cast will help you to better understand the timing issue I'm referring to. I fished many years on a spring creek where there was virtually no back cast to be had. I became good enough at the single and double Spey cast using a 9' 5 weight rod with a 36" lead head on the tip of my line and a size 2 feather wing streamer fly at the end of the leader to reach any spot on the water there. The casts I name here are simply very refined roll casts and they can be done with almost any rod.
After saying all that, I still think you should get a 9' rod
If you are a roll cast / wet fly kinda guy, then I would lean toward a medium action rod because it will load up easier on the roll cast for you.