Another interpretation: "And it came to pass after the seven days" (Genesis 7:10) teaches that the Holy One, blessed be He, suspended for them the seven days of mourning for the righteous Methuselah, so that they might repent. But they did not repent.
Seven Days of Grace for the Mourning of Methuselah
Yalkut Shimoni on Torah 56:5
דָּבָר אַחֵר, וַיְהִי לְשִׁבְעַת הַיָּמִים, מְלַמֵּד שֶׁתָּלָה לָהֶן הַקָּדוֹשׁ בָּרוּךְ הוּא שֶׁבַע יְמֵי אֶבְלוֹ שֶׁל מְתוּשֶׁלַח הַצַּדִיק כְּדֵי שֶׁיַּעֲשׂוּ תְּשׁוּבָה וְלֹא עָשׂוּ.