Thanks Jarek, that's certainly helped to wrap my head around the treatment of the variables. Now for the fun part of trying to work this as a UI when creating a new document!
I definitely understand about the problem with an already existing document as the marginPreferences only deal with single pages. Setting this up to create a new document from the get-go is the way to go!
S