Has-docked-delay can already handle this! The 4th argument is an integer representing the number of times the ship will have to have docked. So, what you need to do is link that 4th argument to a variable. Then, every time has-docked-delay becomes true, do a VARIABLE + 1. Then, as long as your 'when' event has multiple triggers, you can detect every time 2 ships have docked.
Now, I suppose it could be that you want to check every time a single ship is docked and that it doesn't matter what it could be docked to. That gets a little more difficult and I don't have a solution off the cuff, but if you need it, I'll think it through.