This phenomenon roots in grammar only, not in style or metrics.
Dative Case
To understand this sentence's grammar, first and foremost you need to know that the predicate (the verb phrase) is jemandem wird übel ("someone gets sick"). As you can see, this requires the dative case and this is why einem is in dative case. That use of dative follows a pattern where dative expresses a subjective perspective, a relation to the subject, most often a certain feeling. Examples of this pattern include:
- jemandem ist schlecht ("so. feels sick")
- jemandem ist kalt ("so. is / feels cold")
- jemandem ist traurig zumute ("so. feels sad")
- jemandem ist nicht danach [X zu tun] ("so. is not in the mood [of doing X]")
- etwas ist jemandem zu [Adjektiv] ("sth. is too [adjective] to so."): diese Aufgabe ist mir zu schwer ("this task is too hard for me").
An English correspondence to this use of dative case is the term to someone, which expresses the same sense of subject-relatedness. It feels to me that the English to someone came into existence to express that very same relation when English got rid of the dative case. This idea is backed by the fact that English to is also used in other cases to express a relationship where German uses the dative, namely in when the German dative has the function of a locative. But this is just a personal hypothesis from me, being someone who has no idea about the development of the English language.
The Structure of the Subclause
The subclause als einem dabei werden könnt has no grammatical subject, i.e. no noun-phrase in nominative case. Not every German sentence has a subject, and this is one example of this phenomenon. (In fact, jemandem wird übel was the prototypic example for a sentence without a subject in the grammar lecture I once attended as a student.) The reason lies in the structure of the verb, which has a dative valence, but no nominative one.
Meaning of einem
einem itself is the declined form of the impersonal pronoun. In undeclined form, the impersonal pronoun is man. But this cannot be declined (don't ask me why), so when declined, German uses declined form of einer. At least in some dialects, einer can even be used as the nominative form of the impersonal pronoun. An example:
- da wird einer ja wahnsinnig ("one just gets crazy over this")
The English correspondence is one.