No, your script won't work as written, because you're trying to set variable values on the prefab itself, rather than on the instance which was just created.
The Instantiate function returns a reference to what was just created, so in theory you could do this:
var newBeanBag = Instantiate(prefabToInstantiate, pos, rot);
newBeanBag.someVariable = someValue;
...as long as the prefabToInstantiate is a reference to your script on the prefab, not the prefab gameobject itself. For example:
Correct:
var prefabToInstantiate : YourScriptName;
Incorrect:
var prefabToInstantiate : GameObject;
// or
var prefabToInstantiate : Transform;
This is because the "Instantiate" function returns a reference to the type of object from which it was created - although it still always builds a complete new instance of the prefab including its mesh, transform & scripts attached.
So if your prefab reference variable's type is actually the type of script that you want to manipulate on your prefab (i.e. the name of your script), then you'll get back a direct reference to the new instance of the script on the new prefab. All put together, it would look like this: (I have renamed your script "BeanBag" in this example, to be consistent with unity's conventions. You should do the same - rename the file "BeanBag").
var beanBagPrefab : BeanBag;
function SpawnBeanBag() {
var newBeanBag = Instantiate( beanBagPrefab, pos, rot );
newBeanBag.playerNo = this.playerNo;
newBeanbag.roundNo = this.roundNo;
}
If your prefab reference variable's type is "Transform" or "GameObject", then you'll get back a reference to the new instance's Transform or GameObject respectively. In this case you would have to use "GetComponent" to then grab the reference to the script, like so:
var newBeanBag = Instantiate( beanBagPrefab, pos, rot );
var theScript = newBeanBag.GetComponent(BeanBag);
theScript.someVariable = someValue;
So you can see that by using your script's type as the variable type in the first place, you can completely avoid this step of having to instantiate and then grab the reference to the script on the new instance.
Of course if you are most interested in getting back the transform of your prefab, rather than the script on it, using Transform as the prefab variable type is completely fine. However it's worth remembering that if you did use your script as the prefab type, you can access its transform, gameobject and other component properties directly, like this:
newBeanBag.transform
newBeanBag.gameObject
newBeanBag.renderer
newBeanBag.rigidbody
// etc
And yes it's best not to use Instantiate as the name of your own function. It's possible to use the same name in multiple places but it means you have to add prefixes to specify which function you're talking about, like "Object.Instantiate" to differentiate it from "this.Instantiate".