Hi @Alesa Little9,
Hope you're doing well!
Yes, you can simply paste the code and add it to the community.
Alternatively, if you'd like to add it as an iframe, you can add the code in the HTML box.
In order to learn more about how Salesforce Chat Agent iframe works, you can visit this article in their forum- https://developer.salesforce.com/forums/?id=906F0000000D9BNIA015