Yes, you have understood the basic meaning. Harry was confused about something, and then he figured something out. It is helpful to look at the context to better understand this. So what is going on at this point in the story?
We know that Harry has had a crush on Cho for more than a year already, and at the last meeting before Christmas they even kissed for the first time and Cho said: “I really like you, Harry.” However, they have never been on a date, and Harry has never expressed his feelings to Cho.
The interaction you ask about takes place the day after they get back from the Christmas break, so it is the first time Harry and Cho have seen each other since they kissed. Now it was established in the conversation with Hermione after Harry kissed Cho that Harry is quite clueless when it comes to girls, dating, romance, and emotions. So when Cho approaches Harry in this situation, he is not thinking about their relationship. He is just thinking that he likes her and she caught him at a somewhat awkward moment:
“Hi, Harry,” said a voice behind him. He turned
around and found Cho standing there.
“Oh,” said Harry as his stomach leapt uncomfortably.
Their conversation starts off with small talk about how they enjoyed their holidays, and then Cho tells Harry that there is a Hogsmeade visit coming up. This is where Harry's confusion begins:
“Right,” said Harry, wondering why she was telling
Cho is preparing to move their relationship forward, but Harry is clueless. Since he doesn't know why she's telling him about the Hogsmeade visit, he says the first relevant thing he can think of which is about the scheduling for the next DA meeting:
“Well, I suppose you want to — ?”
However, Cho didn't realize that Harry cluelessly didn't process her advances, so she interpreted his statement as relating to her goal, even though that's not what Harry meant. Cho thus assumed that "I suppose you want to" was Harry's way of asking her out, and thus her response:
“Only if you do,” she said eagerly.
At this point Harry realizes that there is some miscommunication going on, because "only if you do" has nothing to do with wanting to know when the next DA meeting is:
Harry stared. He had been about to say “I suppose
you want to know when the next D.A. meeting is?”
but her response did not seem to fit.
Harry is still clueless, and is at a loss for words:
“I — er —” he said.
Cho, who still thinks that they're talking about going on a date, interprets that as Harry not being so enthusiastic about the idea, so she pulls back:
“Oh, it’s okay if you don’t,” she said, looking
mortified. “Don’t worry. I-I’ll see you around.”
At this point their relationship might be on the verge of imploding due to the confusion in this interaction. But then comes the key line:
She walked away. Harry stood staring after her, his
brain working frantically. Then something clunked
When Harry thinks about what is happening he finally figures it out. "Something clunked into place" is the moment when he understands what was actually going on. He finally realizes that Cho wanted to go out with him and that she was telling him about the Hogsmeade visit (and specifically mentioned that it was on Valentine's Day) in order to get him to ask her out. He realizes that he misunderstood her and is about to lose the opportunity to ask her out, and then quickly tries to save the situation:
“Cho! Hey — CHO!”
He ran after her, catching her halfway up the marble
“Er — d’you want to come into Hogsmeade with me on
“Oooh, yes!” she said, blushing crimson and beaming
So understanding all this context we can see that "something clunked into place" indicates that there had been some confusion surrounding the conversation and that confusion was removed. The clunking into place is the specific thought that put everything together. You can think of it as a puzzle that is missing a piece so you can't really see the picture, but then you get the missing put it into place, completing the picture.
The specific word "clunked" may have been used for particular emphasis, but other words could have been used with similar effect. For example:
Then something fell into place.
Then something clicked into place.
Then something rolled into place.