Align New Objects to - toggle script

Hello,

Is it possible to write a script that would toggle option Align New Objects to (World/View) in Preferences/Editing?

So that it would be possible to sign it under the hotkey?