Using acoustic foam between two windows to block out noise
"I'm sleeping next to a busy road with a lot of traffic noise" 

You and me both. My situation/window is almost identical but I do not care about light because i live in Alaska and i want to block the light from coming in at 4:00 o'clock in the morning.

I did as you suggest, i put 2" open cell foam insulation  ( white with silver foil on one side ) in between the inner and outer panes of glass. It does work for the higher frequencies but lower ones travel through walls ( solid objects ) more readily.  I would like to replace it with closed cell foam to see if it is better with sound and light. 

I used to sleep with a fan running for the white noise but now i use a sound generator app on my iPhone. It helps to mask the road noise.