Usually when you get non-manifold stuff in OpenScad it is because you are taking the difference of two things where the edges are at the same location.

This is problematic:


Code:
difference() {
cube([50,50,50]);
cube([25,25,50]);
}
You will usually even see the 'phantom' edge in the picture that OpenScad renders. Instead, doing something like this produces a clean manifold:
Code:
difference() {
cube([50,50,50]);
translate([-.001,-.001,-.001]) cube([25,25,55]);
}