Actually, the ending is even more complicated than that. Even though Judas has come to some understanding of what he has done, his mind is so utterly dark that he blames God for causing him to betray Jesus:
My mind is darkness now
My god I am sick
I've been used
And you knew
All the time
God I'll never ever know
Why you chose me for your crime
For your foul bloody crime
You have murdered me!
You have murdered me!
Yes, and that's actually very reasonable.
I have a friend who is an itenerant teacher who points out that you can always tell in the Gospel when someone has finally figured out who Jesus is. They stop calling Him "rabbi" and start calling Him "LORD."
At the last supper, Judas is still calling Jesus "rabbi."
Judas never got it. He only came along for the parties and the money.
Shalom.