Since we know that the only sin that is not forgiven is the sin against the Holy Spirit, could Judas Iscariot have sought forgiveness instead of falling into despair and hanging himself?
Yes, of course. Bishop Fulton Sheen, in his book Life of Christ, devoted a chapter to the betrayal by Judas, contrasting it with the betrayal by Peter—with which it was similar in some respects—and concluding that the tragedy of Judas’s life was that even after the betrayal he could have been St. Judas Iscariot if only he had repented instead of despaired. The sin against the Holy Spirit, the one that cannot be forgiven, is the sin of final impenitence. God can forgive any repented sin, but man must repent of his sins before he can be forgiven. As only God can judge hearts, we cannot know whether Judas was impenitent to his very death, but we can know that he did not demonstrate the heroic virtue of Peter, who repented his betrayal of Christ rather than allow despair to consume him.