Should I simply repost the answer and reference the commenter? Thanks a lot in advance!
Leave a comment reply to that submitter and suggest they post it as an answer, and if they do then you can accept it.
If they don't, after a reasonable time then sure, leave it as an answer yourself (crediting the commenter ideally).
The aim of the site is to build up a useful repository of questions and their solutions, so if someone doesn't want to leave an answer then there's no problem doing so yourself. It's to the benefit of the site, and the community overall.