Perhaps it was a joke on Gandalf's part. Black Riders from Mordor are chasing after hobbits, so it would be funny for the Black Riders in turn to get chased down by massive White Riders from Rivendell, and then sent packing back to Mordor. Tit for Tat, but in a way that the...former word....completely crushes Sauron's tat. You pull a knife on me, I pull a gun on you, sort of thing.
Has it been covered but how did Elrond know that the ringwraiths were crossing the river? Could he see out his window all the way from Rivendell or did he just sense a disturbance in the force?
And if he did sense it by some means, how did Gandalf know? Did Elrond say, "Hey Gandalf, my Elf Lord sense is tingling, I think there are some Nazgul crossing my river so I am about to send a massive wave to crush them. Want to contribute anything?"
"Hm...WHITE HORSES."
Which then raises how far across land does Gandalf's own powers extend? Can Gandalf make things occur when they are beyond his sight? (although I know his powers were piggybacking on Elrond's)
But my point being is how did he even see the waves in order to contribute, since he certainly doesn't have Elrond's excuse of Elvishness? Though it is possible the magic wave of white horses was a booby trap, set to spring upon any fell creature touching the water, and Gandalf helped Elrond set it.