Automating Tasks

Total newbie so forgive me if this is laughably obvious. I want to create a script which will automate a set of tedious tasks I have to repeat on imported meshes from SketchUp (.3ds).

I want a script that will, for every mesh object in the scene, run these commands (edit mode);

Mesh–>Faces–>Convert Triangles to Quads

and then

Mesh–>Vertices–>Remove Doubles

Sounds simple… but how do I do it? I will learn Python but how do I access Blender’s internal commands (I’ve looked at the Blender Python API docs but don’t see these commands listed) or can I just feed Blender the key strokes (Alt-J followed by W,5)? I can utilise some of the existing “Clean Mesh” script for running through all the selected meshes.

Any help would be much appreciated.