"while" and "as" are conjunctions connecting statements about things that happened concurrently. The punctuation encourages the reader to group the ideas like this: X, [while Y as Z] Though here this doesn't seem to matter much to the overall meaning, and may not actually be the most logical choice.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.