One way would be to put it in the same animation
<animate id="close" begin="0s" repeatCount="indefinite" attributeName="d" dur="2s"
values="M 0,0 L 100,0 100,50 100,100 0,100 0,50; M 0,50 L 100,50 75,50 100,
50 0,50 25,50; M 0,50 L 100,50 75,50 100,50 0,50 25,50; M 0,0 L 100,0 100,
50 100,100 0,100 0,50" />