Dangling modifiers are separate from the word they modify, resulting in ambiguity, confusion or nonsense. In the example sentence, it is not clear which animal is walking the wire - whether the dog or the squirrel. Supposing the squirrel (which is about to fall) is walking the wire, a correct version of the sentence would be:
My dog waited for the squirrel to fall, which was walking the wire.