When Edo Tensei ends, the summoned soul is freed from the Edo Tensei's control, and then the soul ascends to the pure world (afterlife). However, there is a small "grace period" between the two. During this grace period, the soul can act freely.
During that grace period, Dan used the Reika no Jutsu to go meet his girlfriend. Itachi shared his memories and feeling with Sasuke (though granted he had been freed from the Edo Tensei's control long back). Most other shinobi stood around doing nothing significant.
However, during that grace period, Madara released the Edo Tensei's summoning contract itself. As such, his soul is no longer bound to "ascend to the pure world" and can continue to stay in the impure world.
He could have done the same thing even before the Edo Tensei was released, if Kabuto had let him, and the effect would be the same. Also, if others knew the seals and chose to use them, they would be able to stick around too.