It's not the valve body, it's the classic burnt, worn out Overdrive band. The band is so worn, the overdrive doesn't engage, and in your case, only sometimes.
You'll have to remove the trans to replace this, and every shop or mechanic will tell you that if your going in to replace that, you...