One trick to make this happen would be to use a closure to ensure the function is only executed once:
var myFunction = (function () {
var neverCalled = true;
return function (arg, arg2, arg3) { //Any args for myFunction should be set here
if(neverCalled) {
neverCalled = false;
//Put your function code here.
return true; //or whatever
}
return false; //or do nothing, or whatever
};
}());
So when the function is "declared", it immediately evaluates the outer function and sets neverCalled to true, it then returns the inner function (this would be the function you want to execute only once) into the myFunction variable (or in your case, you want it to be the populatePayPlan variable I think).
The first time you call myFunction, it will run, but set neverCalled to false. Any subsequent executions of the function will skip the block and do nothing. It's a simple and nifty trick that takes advantage of JavaScript's first-class functions and closures aspects and should take care of your needs.
UPDATE:
Here's how it should run (note I modified the example code above):
myFunction(); //is true;
myFunction(); //is false;
myFunction(); //is false;
Just make sure to declare it somewhere where you can access it and don't call it until you need it. Hope that helps!
SessionorViewStatekey to store whether or not you've registered that script already, and if you have, don't register it?