Question: a bit of background to the question, I'm a junior developer and we have recently been given flexitime which so far is working well as I get to start at 8am and leave at 4:30pm.

Today I arrived at 7:30 (I like to be early so I can have a coffee in the office before I start my work) however no one arrived to open the office until 9am.

So my question is, should I leave at the the normal time (5:30 pm) or when I would usually leave(4:30 pm)?

Answer: 
Unless there was a pre-existing conversation with your boss that you were coming in at 8 and that someone would be there to open the office then I'd say that this time you'll just have to take it on the chin and work till 5:30.

What I would do though is explain to your boss (in a non-confrontational, non-accusatory way) that there was no-one to open the office when you arrived and ask if you need to be letting people know about any plans to arrive "early" to ensure a keyholder opens up, or if the office *won't* be opening pre-9:00 on a day you were planning to come in early that you can at least adjust your plans.

Most likely this is just a blip that is down to the organisation adjusting to the flexitime (you mention it is a recent development).
Today, work till 5:30. Yes it's not your fault that you couldn't start at 8 - but you still need to ensure you're working your contracted hours. 

Make sure today though that you discuss with your boss what happens in future. If the company is offering flexible hours - they need to ensure you can start work when you want to (because that's the whole point).