If you want to know what the passage "literally meant," we should start with a literal translation. After all "unaware of it" is a paraphrase. This is literal:
Leviticus 5:4 KJV Or if a soul swear, pronouncing with his lips to do evil, or to do good, whatsoever it be that a man shall pronounce with an oath, and it be hid from him; when he knoweth of it, then he shall be guilty in one of these.
In what way can his oath be "hid from him"? The most obvious meaning to me is he forgot about the oath. So he violates it. Then when he remembers about the oath, he is guilty. In other words, the idea is he is unaware of the oath when he breaks it, not when he makes it.
After all, the OT has nothing against oaths, only against breaking them, as Jesus points out in the Sermon on the Mount:
Matthew 5:33-34 NKJV Again you have heard that it was said to those of old, ‘You shall not swear falsely, but shall perform your oaths to the Lord. But I say to you, do not swear at all:...
So he can only be guilty according to the OT after breaking the oath, meaning that it must be that it was "hid from him" when he broke it, not when he made it.
Of course, swearing to do something that violates the Law would also make him guilty, either after violating the oath or keeping the oath and thus breaking the commandment in question. So the explanation of the passage could possibly also be that there is an elipsis, i.e. words that are left out that the author figured the reader would know were implied. In which case it could be understood somewhat like this:
Or if a soul swear, pronouncing with his lips to do evil, or to do good, whatsoever it be that a man shall pronounce with an oath, and it be hid from him [that what he is swearing is contrary to the Law]; when he knoweth of it, then he shall be guilty in one of these.
The JPS (Jewish Publication Society) gives this translation:
Or when a person utters an oath to bad or good purpose--whatever a man may utter in an oath--and, though he has known it, the fact has escaped him, but later he realizes his guilt in any of these matters--
I think that's far superior in clarity to the majority of the modern translations I've looked at.