How can I create a custom button from copied python text of completed actions such as selecting multiple objects?
In blender actions are performed by operators. We can use python to create custom operators that perform (almost?) any custom task that we want. An operator can be run by attaching it to a keyboard shortcut, a button within the UI or by searching for the operator by name in the search menu available by pressing space.

Different parts of blender's interface are separated into panels - which are the UI blocks that can be expanded/collapsed. We can create custom panels to display what we want and specify where we want the panel to be displayed, such as object properties, 3DView toolshelf or properties region...

By defining a custom operator and/or a custom panel you can customize any task as well as provide a custom interface to access the tasks. While you can run a python script to add these it is usually preferred to create an addon that defines each component which can be cleanly enabled and disabled. There is a tutorial in blender's python API docs on creating an addon as well as example templates within blender's text editor.

It is also common to create a custom panel that is specific to a rig, often buttons are used to show/hide parts of the rig as well as control IK/FK etc. One example is the rigify addon included with blender, it creates the following panels for the generated rig, as it is specific to the rig it uses a script that gets run when the blend file containing the rig is opened.