You won't be able to override the functionality there and insert a call to another script in a supported manner. But you might consider a slightly different approach. Hide the existing button and add custom buttons to the ribbon in its place - one for
Close Complete and the other for Cancelled. With this set up you can specify JavaScript that runs when the button is clicked - you can add a call to your additional code and then also use some script to close the appointment.
Jason Lattimer
My Blog - Follow me on Twitter - LinkedIn