XF 1.1 Embedding a script in a post as custom BBcode

In phpbb, I used to add something like:
<script type="text/javascript">affkey="something";boxid={id};</script><script type="text/javascript" src="http://url.php"></script>
as a custom BBcode, and could then use something like [boxid]12345[/boxid] in a post to embed the script. It was for odds-comparison boxes.

I can't figure out how to do the same in XF. I'm using 1.1.5. Does it need a plugin?