How does one go about writing their own commands for a hosted product?
You're basically deploying a thing that'll send http requests to another server which then executes specific tasks. So you've essentially replaced hubot with a web application on the end users servers.
What is the difference?
The end user still needs to run something on their servers to actually do anything for their custom commands, which is essentially what hubot scripts do, which is what my book is teaching people about.