salranax this depends on how that "span" technique works.
If it's a Twitter kind of embed (insert a markup somewhere and a script at the bottom of the page, which replaces the markup with the embed), you might want to add the main script load in the custom header html, then only put the simple markup in the Ads fields.
You might need some <script>
code in the Ads code to re-trigger the fields detection by the script you added in the header though, if it does not scan the page automatically when html changes (in this case, when Flarum adds the code)