Before posting I searched for similar posts and the answers were vague. For example one person giving multiple solutions such as index.tpl and more. I only need one solution.
I have created a feature that displays the dispatch time based on time of day and working hours. This will be displayed on the product page.
Update: Problem resolved. Since I dont need to reuse the script on more pages there is no need to add it as an external script. So i added it together with the html (on top) and it seems to be working just fine.