you might find a script tool the easiest to create initially Create a script tool—ArcGIS Pro | Documentation
what is coordinates = [] intended to be doing?
Your code won't work right now in any environment. You need to create a shape object using arcpy.Polygon(), you can't just stuff a list of coordinates in a shape field. Good examples in the help:
ArcGIS Pro Help: Writing Geometries
Once you get this working at the Python command line (or a python notebook) then you can go ahead and create a script.