When you're in the script editor, you can simply copy and paste your script into the Python tab on the
lower half. Then select all (ctl + a), and then hit (ctl + Enter).
Things to make sure you've done, either in your cut/paste script or by using userSetup.py, etc...
import maya.cmds as mc
This line gives you access to maya commands, i.e. mc.select(), etc...
If you get an error, the script editor usually gives you a line number and indication of what went wrong.
hope this helps, good luck!