If I understand your question correctly, you want to check to see if you are running a script as a script tool or not. If it is running as a script tool, you want to set some variables using GetParameterAsText, and if it is running as standalone, you want to use some hard coded variables, is this correct? If so, you can do the following:
if len(sys.argv) > 1:
#Assign input and output parameters for script tool
par = arcpy.GetParameterAsText(0)
# Hard coded parameters for testing
par = 'Hello'
By checking the length of sys.argv you are determining how many parameters are being passed to the script. There is always at least one parameter (the location of the script itself), so if there is more than one being passed, you can assume that ArcGIS is sending them (unless you happen to be passing arguments from somewhere else).