を行ったり来たりしていた

was going back and forth

→ を
phrase Rare #38,975
was going back and forth Describes repeatedly moving between two places. The を marks the area or route where the movement took place, and していた indicates an ongoing action in the past.
JA: 彼女は駅の前を行ったり来たりしていた。
EN: She was going back and forth in front of the station.

彼は彼女の家の前を行ったり来たりしていた

He was pacing back and forth in front of her house.

見知らぬ男が歩道を行ったり来たりしていた

A strange man was pacing back and forth along the sidewalk.

トム落ち着かない様子部屋の中を行ったり来たりしていた

Tom paced back and forth around the room restlessly.

見知らぬ男が私の家の前を行ったり来たりしていた

A strange man was pacing back and forth in front of my house.