You may find you need a ; on the end.

/script LeaveParty();

Should work fine everytime. When I press Ctrl+I everone in my team gets invited to my group thanks to an ISBoxer Macro. When I press Alt+I it sends the above to everyone and they all leave group.