You need blackout curtains. We all do. They are the best sleep aid ever.
It's a possible project, but you would need to not only have something that opened and closed, you would need a fan system to drive the air, and you would need to have it be thermally insulated when closed, and unless you have a very conservative cooling algorithm you would probably want a heating system to deal with the room getting too cold because the room itself is not thermally sealed.
It ends up being a DIY air conditioner/heater, which I'd rather just buy.
If the goal is just to maintain a temperature I don't think you need to go to most of the lengths you mentioned. You have a window that is currently adequately insulated when shut. This is intended for maintenance so no need for a fan to speed things up. However the room is getting too hot now will suffice to heat it back up if needed, but again being slow means it shouldn't overshoot badly either.
It still may not be worth your time, but if just cracking a window would be sufficient cooling for most of the year it could be.
I think there's something here, but I haven't figured out what or how to fix it.
Things I've found that have helped:
A thorough eyemask and good earplugs reduce the awakenings and help me sleep in a bit longer.
An air conditioner that runs into the morning to keep it cool - I think the air temperature warming after the sun comes up starts to trigger wakefulness?
Cutting out sugar and caffeine after 6pm, which helps getting to sleep a little.