If you search my username and my recent posts you'll find quite a saga with my 66rfe tranny. I'm under warranty and the dealer has been whacking away at it and it appears as though it's working for now.
I can tell you the last code it threw was the P0871 and they replaced the valve body and it's now working the best it has for some time but I've only got a couple hundred miles since the last repair.
From what the service writer tells me, the valve body can be replaced with the tranny still in the truck so it may be worth a try in your case. When mine failed (for the 2nd time of 3) it would go into limp mode up around gears 3-4-5 after moderate to hard acceleration. It felt as though the tranny was starving itself for fluid and would over-run itself then slam into gear. Not sure if that makes any sense but that's the best way I can describe it.
I went limp mode a couple times and then drove hundreds of miles before it finally gave out. Hard to say if the valve body was the cause or a casualty in the whole thing.
Just reread you post - you say you're having a problem with limp mode IN 4th gear. Just to clarify, limp mode IS 4th gear only and 1st when you slow to a stop.