The success of your AOS will depend on the extent of their knowledge of your unemployment and how adverse of an interpretation they have.
A very adverse interpretation would say that your change to H4 status is invalid because your OPT was invalid due to the 90-day unemployment rule, and the H4 being invalid would make your AOS invalid. Of course, you could say that they approved the H4 so it's not invalid, but they could say that the H4 was approved with the expectation that you would leave the US and reenter with the H4 to properly initiate your H4 status. Or that the H4 was approved without them knowing about your length of unemployment until they investigated it during the AOS process, and if they knew about it when you applied for the H4 they would not have approved it.
Note that I'm just playing devil's advocate and I don't actually expect the above to happen. I'm just pointing out possible interpretations if you got a hostile adjudicator evaluating your case.
So you have some options:
1) Go ahead apply for AOS and hope it will be OK.
or
2) Exit the US, reenter with the H4 so you'll have a clean H4 status, and then apply for AOS. This will require H4 passport stamping at a consulate, unless you're Canadian.
or
3) Use consular processing, don't use AOS, so the issue of being in valid status when filing for AOS will be moot.