@silvianrusso just get rid of those orphan loops and u should be fine. But keep in mind that that cilinder u just booleaned could use some more segments. Like someone mentioned above, u can terminate loops almost anywhere on flat surfaces. Cheers! :)
@christrom There's a bit of subtle pinching caused by the extra loop between the base of the square and the loop path on the surface of the sphere. Dissolving the loop and merging the corner vertices of the triangular quads should resolve the smoothing artifacts while also simplifying the mesh. (See the third and fourth…
Add more loops on the cylinder, the one you have currently moves down quite far. Maybe even start with more segments on the cylinder. More loops everywhere really. Also try p-sub (Shift+Tab) instead of normal subdiv (tab), unless you already are.
One reason that just came to mind for me to "justifiably" use epoly is when I am just only making edge loops for my mesh, but even than I think its still better to just keep it at the base level and make a copy for the edge loop process.
One method I'd suggest, is to bevel the corners and inset a support loop, then crease plus adding further loops to harden the control edge defining a rectangular shape. (Note - ngons can be used on planar surfaces once smoothed without throwing distortion or shading errors with subdiv applied)