Capitilize Alt/Title Tag in Image HTML, Reorder HTML Output

I’ll give you a partial answer.

In your first function you may use ucwords() PHP function:

$alttitle = ucwords( str_replace( '-', ' ', $alt ) );

Second task is more complicated. I don’t have a ready solution for you but the direction should be to extract attributes and values from HTML (playing with preg_match()), store them in variables and concatenate in a different order.

Now a side note. Personally I prefer to filter output of the content than modifying the code that is sent to editor. If my mods (for example class name or HTML structure) will go in conflict with some plugin or theme I can easily adjust them as they are not stored in the database.