(to be) troubled for some time, while inventively looking at the screen.
(to be) worried for a while, while gazing at the screen.
1)2)"しばし画面を見つめながら悩む" という意味です.
しばし: for a while / for some time.
画面を見つめながら: while inventively looking at the screen / while gazing at the screen.
悩む : (to be) troubled / (to be) worried.