You seem to already be aware of the difference in your question, which is that the middle stroke in 曰{いわ}く does not go all the way across, so that it does not touch the vertical stroke on the right side.
So I think the issue is one that I remember having a long time ago when first learning kanji, which is an underappreciation of how exacting the Japanese language is about writing kanji. In English, there are many different scripts, fonts, and ways of writing, so there could be many ways to draw a letter, but it's still the same letter.
For the most part, though, small differences like that which differentiates 日{ひ} and 曰{いわ}く really do matter and signify entirely different characters. (Which moots your other question about how it is the same character is used for such different things, since they are not, in fact, the same character).
Take a look at this page which gives a list of kanji characters that look very similar. Note the subtle differences between 己{おのれ}, 已{のみ}, and 巳{み}.
On my computer, the difference between 日{ひ} and 曰{いわ}く is not clear because of the font I'm using. If that's the case with you, look at this page which shows a clear graphic of how to draw 曰{いわ}く, so you can see very clearly that the middle stroke is intentionally not touching the right side.
Having said all that, you should also be aware that sometimes there are small differences in the conventions of how kanji are drawn, so that there are cases where the same kanji can be drawn differently, depending on the font or the person writing it. Take a look at this question especially, and also maybe this question to explore those issues.
Hope that helps.