At Promise Engineering, we’ve open sourced our code that does intelligent SMS message splitting. It can do useful things like ensuring messages are split on a space character, and that template tokens are never divided across messages (e.g. an address).
Get it on NPM at https://www.npmjs.com/package/sms-splitter
See the source code at https://github.com/PromiseNetwork/sms-splitter