Alrighty then, I have news!

I read all of your comments, first of all: thanks!
I sat on the breadboard again and: I made it work.

But step by step.
Here is what
the status quo was: I captured (with 500ms persistence time) the signal from the
HCPL3700 optocoupler (1) and the first counting pulse (2) it triggered in the
CD74HC390 counter … and as you can see: this is garbage. Wild jumps on the logic level, no wonder that the counter produced such a weird looking pattern. The rising edge is somehow ringing, maybe that's why sometimes it was interpreted as an additional falling edge by the counter IC.

Here is a capture of the rising edge – this was with 2,2kΩ as a pull-up on the optocoupler and 220Ω as a "pin protection" on the counter:

And here is the falling edge of that signal:

I then tried
some other optocouplers:
6N138 and
ILD620GB – with an even more terrible Fall Time.
6N138:

ILD620GB:

I discarded that and switched back to the
HCPL3700. And I was able to
clean up my signal. I simply used 100k as a pull-up and connected the optocoupler's output directly to the clock input of the counter. So I use a much higher value now as a pull-up, not a lower one. I don't know why I used the 220Ω resistor as a pin protection in the first place. Guess I had this in my mind from some Arduino tutorials ("Protect your pins! Never connect something directly to the pins or the current will destroy it!" Stuff like that ...).
I also decoupled the optocoupler now on pins 5 and 8 with a 0.1µF capacitor like the datasheet suggested. It made a liiiiittle difference, but not much. I also grounded the unused pins of the CD74HC390 counter. It made no noticable difference.

And now the signal looks like this – the rising edge:

And the falling edge:

Much more clean! But it did not want to work. Still counting rubbish.
So I decided that it is now time for some zeriouzz Schmitt action! For this, I first moved the optocoupler on the breadboard a little bit away from the counter IC, to make some space for a Schmitt trigger IC. But before installing it, I measured my optocoupler's signal again: lo and behold!, it was even better and now the counter triggered correctly! My pulse signal is divided by 10:

(My scope is of course not a 5-channel one – I photoshopped that for you.

)
This is what you would expect it would look like – but I couldn't believe this. So I switched back and forth and back and forth the position of the optocoupler on the breadboard. Sometimes it seemed to work, sometimes there were some small glitches on the scope, but after all the dividing was correct. So I can only assume, that a mixture of signal quality and bad connnections on the breadboard or the fact alone that I use a breadboard is all part of the problem. I have no clear explanation for this behavior, but I wouldn't trust this arrangement.
So
back to the Schmitt! I tried two different Schmitt triggers: the
SN74HC14N and the
CD40106BE:
SN74HC14N – Fall Time ≈12ns:


CD40106BE – Fall Time ≈27ns, but cleaner signal:

Side quest: Why is it that with the SN74HC14N (a CMOS device) the signal is faster but more jittered? With the CD40106BE (also a CMOS device), for me it's fast enough, I have clean levels and edges and it works very reliable so far. This means:
I'm happy and we solved the problem.

So here it is: my little optocoupled, Schmitt-triggered, AC pulse divider:


With it I'm dividing the 50Hz mains frequency (Europe) to a 1Hz signal. The LED flashes every second. This was the goal for this project.

I hope this was insightful for someone, especially for the beginners who don't own a scope yet, to better understand and see "the inner workings" of all this stuff in more detail. I remember, back in the days, when I was scopeless, I would have wished for some real world pictures and explanations like this.
You're welcome to add, comment, suggest and recommend to this learning project.

Thanks y'all!
