Currently there is no way to save the pattern code progamically from a plugin unless the builtin plugin is modified to add those events. This pull request will be adding ability to load and save pattern code from specified file.
application/octet-stream