just tried the
$background = $skinDir . $skin . "back.bmp";
and it looks fine in the message box that i have poping up.
but the pref never changes. it just stays the same original value
which points to the profile directory for the back.bmp
That's is probably because of the way K-M does preference handling, see bug 23. To confirm it is because of the same thing that causes bug 23, run the macro and then check the prefs.js file before you close K-M, and see if it is set to the right back.bmp file, and then close K-M and check it again after. If it was changed while K-M was open, but after K-M closed it went back to what it was before, then it is because of the pref handling that results in bug 23. If it is, there doesn't seem to be much you can do about it for now.
No, it never changes after the running the macro, before or after closing. I wrote about this in a thread awhile back and got the same results with the following attempt: