No code samples, but one approach would be the following:
* Create button on toolbar which sets a boolean on your form (new_close) as true. (JS) Call form save through JS to close form.
* Create callout (postcallout) which if new_close = true updates state of Service Activity. [OR] create workflow which if new_close = true updates state. Not 100% sure workflow can achieve the 2nd.