a's As is interpreted as "when", while b's is "while". For b, I think the meaning of "while=as" is when two actions go at the same time. But for a's "when", is "walking" a single action not lasting?
What is the difference between "when" and "while" used as "as" in terms of length of duration or something?
a. As she walked in, Scott was leaving.
b. As he works, he listens to classical music.