u can apply it as long as u filed i-485. Once you use your AP during traveling, u will lose your H1 status. So if your I-140 isn't approved, u will lose your status. U can't change back to H1b.