“I see you are not to be distracted. Very well, the Stone. Professor
Quirrell did not manage to take it from you. I arrived in time to
prevent that, although you were doing very well on your own, I must
say.”
Source: Harry Potter and the Sorcerer's Stone, published by Scholastic.
Sounds like a dialogue but it is still prose with proper punctuation. This is how I think the expression is parsed
I must say [this].
[This] = [I arrived in time to prevent that, although you were doing very well on your own]
So "I must say [this]" is a complex sentence with the clauses in bold (a complex sentence in themselves) function as an object of the verb phrase must say (I bet with an implied that)
Best Answer
"I must say" is an mannerism used by some English speakers. It is used only for emphasis and has no real meaning on its own.
"I must say" is a phrase that tends to be used by older people, who talk in a formal manner (like Dumbledore), and is probably more common in the UK than elsewhere. In narrative it gives some information about the character -- that the speaker is the kind of person who says "I must say" -- but otherwise can be ignored as unimportant to the meaning of what is being said.
In your example the emphasis is one of polite surprise. Dumbledore is both pleased and astonished that Harry survived his encounter with Quirrell, and "I must say" is his way of emphasizing that feeling.
(Edit) As Jason Bassford's comment says it's an interjection without meaning of its own. A character could even exclaim, "I must say!" by itself, and the only way to know the meaning is from the rest of the context:
Here Lord Brumley is expressing indignation at what he perceives as inferior treatment -- but we only know this by inference from the surrounding dialogue.