In AEM richtext component, you can add HTML but scripts are not allowed as soon as you save, it will remove script tags. Its due to security rules in CORS configuration that can be update not sure if it will still allow scripting tags though.embed is an option to be considered if CSS and JS required...