the setpref() macros applied to "javascript.enabled" weren't working right in 0.6 IIRC, but they are in recent test builds, and i presume (no jinx intended) will be in 0.7... images, on the other hand, *should* be toggle-able in that version... for basics on macro/button/etc. creation that can be transposed to things like this, see here:
http://kmeleon.sourceforge.net/docs/toggle.php
(TODO: update this doc per syntax changes for 0.7...)