I hope some grammar experts will add their knowledge, but here is what I think:
Your original sentence sounds a little odd to me, but it might technically be correct (change WASN'T to WEREN'T).. I can't quite pinpoint what makes it sound odd - maybe it's the use of the negative.
"If he were on time, he could get a perfect score." sounds better.
However, even if it is correct, it's a conditional about the future, not what already happened
If you are talking about the past you need something like:
"If he hadn't been late, he could have gotten a perfect score."
I suggest studying the conditionals and practicing a lot of examples. I know it's tricky, because you have to know a lot of tenses.