"While" was a preposition and is now limited to the northern dialect (SOED, 1995 ed.); in the examples you show, it appears to be a preposition because there is no verbal form, but in fact it is not a preposition there, does not function as one, and is really the conjunction "while", the name for the practice of omitting a part of a phrase or clause being possibly referred to an ellipsis. There are numerous cases of this usage that can be collected from the literature. Here are four of them.
1 So, if you want to stay happily married while a student in law school, things will have to change.
2 of the waters of this State or of the United Slates or on the high seas ; nor while a student of any seminary of learning ; nor while kept in any almshouse or other asylum; nor while confined in any public prison.
3 While a student of Virchow, Paul Langerhans was the first to describe the islets in the pancreas that now bear his name.
4 Two recent texts will provide general info that might help you while a student.
Here is a classification obtained from the pdf of an article on English verbless clauses that shows that "while" is a conjunction and that we are really dealing with a verbless clause (while, time).
2.1 Subordinators for Non-finite and Verbless Clauses:
Some of the subordinators that precede non-finite and
verbless clauses appear under more than one heading, so that in
some clauses the relationship they bear may be ambiguous, e.g.
as (time, reason, manner, concession)
as long as (time, condition)
if (condition, concession)
in case (purpose in British English), but(condition in American
English)
now that (time, reason)
since (time, reason)
so that (purpose, result)
when (time, concession)
while (time, concession)
Up to date explanations to be found in the above pdf do not permit to speak of ellipsis specifically in all cases, the contemporary notion about ellipsis being that there must be a unique word that can be inserted. Moreover, not only a verb form is missing but as well, eventually, a verb form and its subject.
The omission of words is only to
be considered ellipsis when the words omitted are “uniquely
recoverable”, i.e. there is no uncertainty about which words have
been omitted. This means that, for example, subordinate non-finite
clauses with no conjunction like "Sitting in the garden, Tom fell asleep."
do not illustrate ellipsis, or only weak ellipsis, since one could recover
several possible conjunctions, e.g. while, when, etc. But missing
words that are clearly recoverable from the text are classified as
ellipsis.
Ellipsis is considered as one of the syntactic processes
involved in connectivity. Parts of the sentence are often omitted in
conversational speech when their meaning is clear from the situation
or verbal context (Crystal and Davy, 1984:4). Halliday and Hasan
(1976:144) claim that where there is ellipsis, there is recoverability in
the structure, that something is to be supplied, or “understood”.
They also assume that its essential characteristic “is that something
which is present in the selection of underlying options is in itself
‘incomplete’”.
On the other hand, some structuralists warn against the wide
use of ellipsis. Sledd, for example, states that the serious difficulty in
using the concept of ellipsis is that native speakers very often do not
agree on the omitted words, e.g. to the question:
What did you say?
a perfectly normal answer would be:
That I’m ill
but the answer might be expanded to:
I said that I’m ill or what I said was that I’m ill.
In your examples one cannot speak of ellipsis according to the distinction that has been explained above: you might consider that the omitted part is "he was" or "being" or also "working as an" or even "employed as an".