You don't need a script to do that, you should be able to just enable outline in the right panel. Alternatively, you can put a text in its own layer and add an Outline effect to the layer style/effect.
Locked
Text with outline
Hey, is there a script that creates text with an outline of a chosen color?