sometime we need to perform some action when activity is closed in MS CRM.In that case you have to capture close activity event, you can do this using event.Mode property in onsave event. you just have to write below code.
if(event.Mode==5) //Close activity event
{
//you code to implement your logic
}
Enjoy !!!