Assuming you are using a custom toolbox (*.tbx), right click your script in the toolbox and select "Properties", select the parameters tab and then right click on the parameter you want to move and select "Move up" or "Move down". And then change the parameter references in your code.
If you're actually using a Python Toolbox (*.pyt) then it's easier, just move the parameters around in your tool `getParameterInfo` method and then refer to the parameters by name using a dict or namedtuple
class Tool
etc...
def execute(self, parameters, messages):
parameters = {p.name: p for p in parameters}
# do something with parameters["some_name"]
# Or
from collections import namedtuple
class Tool
etc...
def execute(self, parameters, messages):
parameters = namedtuple('Parameters', (p.name for p in parameters))(*parameters)
# do something with parameters[0] or parameters.some_name
I also recommend voting for the following idea:
ArcGIS Pro Ideas - Make Python Toolbox parameters a namedtuple instead of a list