A: 선배! - Sempai! (address word for someone a little older. "Sempai" is a Japanese version which is more established)
A: 발렌타인 데이 초콜렛입니다! - Here's Valentine's Day chocolate for you.
B: 아! 발렌타인데이였구나. - Oh, (I see,) it was Valentine's Day.
(-였(다) is past tense of -이다, "is". -구나 is a sentence ending form expressing a light surprise/acknowledgement)
A: 아니, 선배 ... 어떻게 ... - What! Sempai, ... How (can this be)?
A: 여기 서 있으면서 모르셨어요? - You didn't know that standing right here?
B: 제대로 안 보고 졸업식 때문인 줄 ... - I wasn't paying attention, and thought it was about graduations.
So A is surprised that B didn't know it was Valentine's Day while standing before a store with a big sign about it.
B is saying he wasn't paying attention, and thought it (the store being busy, etc) was because it was a graduation season.
It looks a bit funny though, because A looks like a guy to me. So a guy is giving chocolate to another guy for Valentine, which doesn't seem like a common thing.
Anyway, don't hesitate to ask if any part is still unclear.