をしていて

doing … and

→ を
phrase Rare #23,823
doing … and Follows a noun to describe doing that activity, often linking it to what happens next or to another situation.
JA: 運動をしていて汗をかいた。
EN: I worked up a sweat while exercising.

トムはサッカーをしていてケガをしたんだ。

Tom got injured while playing soccer.

アルバートは外国貿易をしていて、しばしば外国へ行く。

Albert works in foreign trade and often travels abroad.

折角来てくれたのに留守をしていてごめんね。

I'm sorry I wasn't home even though you went to the trouble of coming all this way.

トムはアメフトをしていてケガをしたんだ。

Tom got injured playing American football.

彼女は料理をしていて手にやけどをした。

She burned her hand while cooking.

“病院で夜勤をしていて素敵な出会いがありました”

I was working the night shift at the hospital when I had a wonderful encounter.

— キャッチ・ミー・イフ・ユー・キャン (2002)

あきれたことに、彼は試験中に不正行為をしていて見つけられた。

Unbelievably, he was caught cheating during the exam.

君達がおしゃべりをしていては、授業ができません。

I can't conduct the class while you're chatting.

私たち、こんなことをしていてはまずいと思う。

I don't think we should be doing this.