My take on the ending....
I feel like when he killed himself god gave him a second chance to do it all over. Because of free will though it was all god was able or willing to do, reset and hope he makes better choices.
As for the devil I guess you could say he is in hell because his plans always fail after years of planning because god resets things therefore never allowing him to succeed.