They were gonna make him the good guy. Because, if you read the plans for Frozen, they said they were gonna make Elsa the bad guy originally until they heard Let it Go. They could have gone through part of the movie not knowing who the bad guy was gonna be, and then someone had an evil genius stroke and, BOOM.
Some fans say that the song is describing Elsa because of her ice powers and it can be true. But when one remembers Anna’s statement to Hans at the near end of the movie, "The only frozen heart around here is yours," they would say that the song is referring to Hans, especially at the song’s conclusion "Beware the frozen heart!"