Last time I took most of my engine apart, I used something like silicone/adhesive/sealant to set rubber gaskets (such as valve cover, manifold-intake, oil etc) into the contoured groove, as per some instructions I can't now recollect. In the case of the valve cover it helped the gasket not fall out when putting it on as it is basically a lid and the gasket is on the down side.
However, I have a suspucion this may be overfilling the gasket housing groove, which may cause a poor fit, which then defeats the purpose of the gasket to seal the joint.
Is it generally recommended or not to use sealant with a rubber engine gasket that matches a groove it sits in?