This is a difficult situation. I would argue that this is fine because once you went and got the green card you took the job and you are just working for the company's operations outside the USA temporarily. So I think it's going to be a touch and go, but that is what I would argue. You definitely need to take a lawyer with you. More...
Note: This is a verbatim transcript of the referenced audio/video media delivered as oral communication, and, therefore, may not conform to written grammatical or syntactical form.