If you feel strongly that the denial was made by mistake, you can file a Motion to Reopen (MTR). Your lawyer should be able to help you on this kind of situation.
If you currently have a valid H1B visa, yes, you can still stay or extend your stay depending on the particular of your H1B.
If you are no longer on H1B and now you are on EAD, you can still apply for H1B (I don't think it will be considered as an extension; I could be wrong). If it is approved, most likely the approval will not contain I-94; therefore, you have to leave the country and obtain an H1B visa and enter with a new I-94 based on H1B.