"Forever" in this context is an adverb. You could also say that it's basically "for ever" without the space. As such, if you're saying that you have been waiting for a very long time, then the latter usage is right.
In the former usage, "forever" is used as a noun. It does not describe how long you have been waiting; instead, as a noun, it represents what you're waiting for. In other words, it means you're waiting for forever, as in the period of time itself, which may itself either refer to an indeterminate point in time in the future or an indefinitely long duration of time.