XF 1.3 Add script tags

Hi everyone! I am a bit of a newbie in making a website work, and I am afraid I did not actually get to the good part of the forum, so please notify me if I'm doing anything wrong :)

I am currently trying to add a script that would interpret certain bbcode tags, and so far it seems good, I can transform the tags [something][/something] into a div I want, but now I need to call the script by adding script tags to the head of the HTML document. It might look silly, but I have no idea what class or what function actually does the job. What should I do?

If you need any more information, don't hesitate to ask :)

Thanks in advance!
Thank you very much for your answer, it works now! Well, I still have to correct a few glitches from the other script, but I have done what I needed to do :)

Thanks again