I believe the correct answer is B. The modifier "wearing a blue dress" is placed far from the noun which is supposed to modify - Stacey. Such as it is, it could easily be attributed to another noun, the stage. It would seem that the stage was wearing a blue dress, rather than Stacey. This is easily fixable with a comma between "stage" and "wearing".
The C and D sentences are also a little bit awkward, but they don't contain a misplaced modifier.
Okay, what Is your question?
Answer:
He was frightened and lonely.
Explanation:
When he went to the window he probably wanted to see the rain and find out what it was, but when he heard the thunder he was frightened. He was also was scared that he was alone while it was storming.
I hope this helps! Have a good day!