These two verses are not in any contradiction. The Son has the authority to judge the world at the end of days. For those who choose to deny Christ on earth, they will be denied by Him in heaven. However, like the beloved apostle St. Peter, if one repents of any sin even if he/she denied Christ, the Son, who also has the dominion to forgive sins, will grant him/her forgiveness and the opportunity for eternal life with Him.
Blasphemy against the Holy Spirit means that one refuses to repent. Repentance is an action and a deed of faith which leads to Salvation. Faith alone does not guarantee salvation, but it is an important component of the process of working out one's salvation. The Holy Spirit is Divine just as the Father and the Son are Divine. Each Hypostasis of the Holy Trinity works with the believers and the unbelievers. The Holy Spirit is your Advocate and Guide. He is the Fire of your spiritual zeal who works in all the believers to rebuke their sins, correct their shortcomings, and comfort them throughout the way and the narrow gate which leads to eternal life.
For the unbelievers, the Holy Trinity endeavors to bring them to faith and repentance. For the faithful, the Holy Trinity aims to advance the believers to righteousness and a life of repentance. This is never against the person's will. Quenching the Holy Spirit is the person's willful contempt and struggle to suppress God's will in our lives which is to lead us to purity and salvation. Thus, if a person does not repent while still here on earth, then when he/she departs from this world, he/she will bear his/her harbored unforgiven sins.