Writing thank-you email to professor for agreeing to write a LOR?
You're over-thinking this. It's almost always appropriate to say thanks when somebody does something for you. You won't be taking up more than a couple of seconds of your professor's time if you send a quick "thanks!"

Suppose that you'd asked for the reference in person rather than by email. You wouldn't say, "This professor is really busy so, the instant they say yes, I'll save two seconds of their time by running immediately from the room without thanking them."