You question is specifically asking how to use GetComponent without generics. And in your case the result would be:
string variable = "SMG";
string scriptName = "SMGScript"
weaponObject = GameObject.FindGameObjectWithTag(variable).GetComponent(scriptName);
But generally speaking, this approach to managing objects is unsustainable. As your project gets bigger and bigger, managing objects by name becomes much less feasible.
And I would personally strongly recommend you do not use an Enum to represent your weapons as is suggested in another, as this approach suffers from the same problems, if not on a much larger scale.
It sounds like what you want to do is store a reference to SMGScript.
The easiest way to do that is to create a field in your script, and set the value in the editor.
If the problem is allowing for multiple types of weapons, use a pattern like inheritance:
Define a base class for your weapons:
WeaponScript : MonoBehaviour
{
public abstract void Fire();
}
Then have SMGScript extend it:
class SMGScript : WeaponScript
Then create a public field to hold a weapon so you can set it in the editor:
public WeaponScript PlayerWeapon; //The editor will let you drop *any* weapon here.
To fire the weapon:
PlayerWeapon.Fire(); //This will let any type of weapon you set in the editor fire
To retrieve the any weapon (Although you probably won't need this, see below):
targetGameObject.GetComponent<WeaponScript>();
If you don't know the object you'll want from the editor (for example, you make the SMG object while the game is running), there is almost always a better way to get a reference.
For example, if this is a pickup, you could use the collision/trigger information to get the correct GameObject.
Or if this is an object that only has a single instance, but you want to define that instance at run-time use the Singleton pattern.