It is a debated point in Job 38:7 exactly who "morning stars" and "sons of God" are. However, this does not matter for the current discussion. The fact remains that whoever these heavenly beings are, they existed before the creation of our world.
Now, whether they were created before the rest of the universe or not is another question entirely about which we have no information.
It is clear from the data in Gen 1 that we have two possibilities to understand the account as we have it. Either:
- The bulk of the universe (including the unfinished earth) existed when God engaged in the series of events over 6 literal days in Gen 1; thus, the events described in Gen 1 only concern the surface of our planet. That is, the sun, moon and stars had been created at a previous time and only became visible on day 4.
- Many believe that the universe was created on day 1 along with the earth (according to Gen 1:1). However, this is problematic because
- the heavens were created on day 2
- the earth was created on day 3
- (according to those that hold this view) the sun moon and stars were created on day 4
- how could the light from such distant object reach us so that distant stars were visible on day 4 unless the rest of the universe is much older?
Further, if this is true, then what was created on day 1 according to them?
For this reason, I believe that option #1 above is true. Therefore, Job records that "sons of God" and "morning stars" praised God as the early stages of creation occurred on earth.
Finally, as to whether such beings existed before the earlier creation of the universe, we are not told; However, I would strongly suspect that God needed to create a place for any such being to live before creating them (as He did on earth). Thus, I believe that these beings were possibly created shortly after the creation of the universe but before earth was created; however, this is my speculation and I only hold it tentatively.