bitmaniac,

Take a look at Configurable Logic Cell (CLC) in some of the new chips like the 16F1507.

I haven't had a chance to try it, so I don't know if will do what you want.
Those chips are supported in PBP3.