So to do this what you will need to do is create a module that does the following.
- Has system configuration for storing your customizations to the js tag,
- Has layout update that will allow you to add the js tag,
System Config
This really depends on what you need to store for this I will assume that a simple text field is enough.
You will need to add the following system.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<config>
<tabs>
<stack translate="label" module="your_module">
<label>Example For Stack Exchange</label>
<sort_order>100</sort_order>
</stack>
</tabs>
<sections>
<stack translate="label" module="your_module">
<label>Example Options</label>
<tab>stack</tab>
<sort_order>1000</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<stack_group translate="label" module="your_module">
<label>Example Options</label>
<frontend_type>text</frontend_type>
<sort_order>1000</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<input translate="label">
<label>Your Input Field: </label>
<frontend_type>text</frontend_type>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</input>
</fields>
</stack_group>
</groups>
</stack>
</sections>
</config>
You will also need an adminhtml.xml file
<?xml version="1.0" encoding="UTF-8"?>
<config>
<adminhtml>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<stack>
<title>Stack Example - All</title>
</stack>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</adminhtml>
</config>
With these two file you will then get an option in the admin config for adding an input.
You can access this value with the following code: Mage::getStoreConfig('stack/stack_group/input');
Layout Update
When you want to add a layout to specif pages you will need a layout update file, this can be defined via the module's config.xml as follows.
<?xml version="1.0"?>
<config>
<modules>
<Stack_Example>
<version>1.0.0</version>
</Stack_Example>
</modules>
<frontend>
<layout>
<updates>
<stack_example module="Stack_Example">
<file>stack_example.xml</file>
</stack_example>
</updates>
</layout>
</frontend>
</config>
Now in the file stack_example.xml
under the layout you will be able to specify specific layout handles to add your template. For example to add this template to the bottom of the cms index page you would use the handle 'cms_index_index' and the reference 'before_body_end'
<?xml version="1.0"?>
<layout version="0.1.0">
<cms_index_index>
<reference name="before_body_end">
<block type="core/template" name="your_stuff" template="path/to/your/template.phtml"/>
</reference>
</cms_index_index>
</layout>
Now that you have this you can simply create your template and in that template file have the js that you need plus using Mage::getStoreConfig('stack/stack_group/input');
you can get the information stored in the admin config.