Can build up on a distibutor cap and build up on the wires cause it to missfire and sputter you cleaned them and it helped?

Anything that would allow the high-voltage to jump to the wrong place would certainly cause the engine to run poorly. Buildup around the outside of the cap would hold moisture which would allow the voltage to arc.