was your head warped is that why u had installed a new gasket? 1st code is a random misfire, u want to make sure u plugged everything they way it was and tightened the head according to specs cause aleak can casue a misfire.
P1111 Intake Valve Timing Control Solenoid Valve dont much about this one but u can check out the engine control section of the service manual and find more info on it aswell as your other code here is the link Knowledgebase - 2002 Sentra - Nissanhelp.com