its a one way valve for the crankcase breather system...
it carriers combustion gases back to the inlet manifold to be burnt again
as for the "sludge" it can collect in there if you do a few short trips as condensation will collect from the engine breather system
try some brake cleaner or wd40 to flush it through