I've had the same problem off-and-on: intermittant brake + abs light. No telling when it would go on, and would go off only after shutting off the truck. The problem was rare... only every few weeks, maybe, but each time for a couple of days at a time.
I replaced the rear speed sensor, but that didn't solve the problem. Then, one day, working under the hood, I noticed that the main vacuum line attaching to the hose barb next to the master cylinder was a little looser than I liked... the hose was stretched pretty wide on the barb. So I cut off one inch of hose, then worked like the devil to get the fresh hose end back onto the barb. Problem solved (I think?)... its been about two months now since those lights last glowed at me. I can't claim that this really did solve the problem, mostly because I don't understand my brake/ABS/vacuum system very well. But I'm cautiously optimistic... .