Update state-machine.js

Added missing '.Result' property + some missing semicolons etc.