It would appear that you could just enable or disable the guest account by using defaults write in the /Library/Preferences/com.apple.loginwindow.plist file, but apparently that just changes how it displays in System Preferences > Users & Groups.
There is a lot that goes on behind the scenes, and this script actually does it (almost) all:
rtrouton has another version of this available, too:
Ready for Munki
I took a modified version of that (without the Lion checks) and cut it up to be a nopkg .plist for Munki:
Workaround for Keychain Issue
Now that the keychain issue is "fixed," you have to hit Enter at the password prompt (instead of just logging in right away), but there is no keychain error at least. Props to this JAMF Nation discussion for the workaround for the keychain error.