That said, yours looks a lot more full-fledged than mine. Mine can only record transactions and then send a response (which it reads calculated from the spreadsheet based on the last transaction, which I'm very proud of for the level of customization it provides), but I've been noodling over how to add custom commands.
FTR, I shameless stole my idea from an earlier HN comment sometime last year; if you're considering implementing a SMS/spreadsheet system yourself, I'd check it out https://news.ycombinator.com/item?id=17313321
Edit: I really am happy with my solution because it basically lets you take any google sheets based transaction you have and add SMS as an input method.
Edit 2: Sorry if you encounter any rough edges if you go to use BYOB - I haven't marketed it widely, but my wife and I do use it. Any feedback is very much welcome.
Edit 3: If you don't want the manual import of transactions (but do want the freedom of a spreadsheet) then I'd suggest TillerHQ instead https://tillerhq.com I haven't used em, but I came across them when doing research before launching BYOB.