With Dolf's help, the code were written. I think it's a good result for now. But another problem came out.
From Blender 2.58, there are no option of 'active_space' attribute. This code uses the 'active_area' for changing the pivot_point to 'INDIVIDUALS' and 'BOUNDINGBOX_CENTER'. So, this code get 'ERROR' on Blender 2.58.