Hi Mitchell,
The code in an HtmlComponent cannot be changed via the API. The only way to modify the code content of the HtmlComponent is with the Edit Code button in the editor. The other option is to embed code by setting the src property to a URL (https only). You can read more about that in the src property API .
Good luck,
Yisrael