Elijah explained the difference, I would probably include 'then' to make it sound more like a cause and effect/if then statement. You can include 'done' to 'done on purpose-- this may make it a but more clear; alternative to 'go away,' you could just say 'leave.' Those are just stylistic preferences, but to me, they make the message clearer.
'If it wasn't done on purpose, then you didn't have to leave.'
'If it hadn't been done on purpose, then you wouldn't have had to leave.
In Russian, I think the second would be more of a бы hypothetical--i.e. if the person hadn't done whatever they did on purpose, then they wouldn't have had to leave. Whereas the first is agnostic to whether the 'thing' was done on purpose or not. I'm not sure if the below translates in Russian in the same way:
1) Если это было сделано не специально, то тебе не нужно было уходить.
2) Если бы это не было сделано специально, тебе бы не пришлось уходить.