Hi,
IIUC your question, alas, there's no generic answer/way to do that, and I don't think that'll happen some day. So you'll have to do trial & error to be able to do things through the script console.
Then my advice is: open an IDE, load the Jenkins jars + the plugins you want to tinker with, and use the code browsing feature to dig through the APIs, and so on.
Not sure there's a better way, but I'd be happy to hear about tips & tricks for it.
And obviously, before that, have a look at the conf slicing plugin!
And after, if you find yourself doing things on a regular basis, consider contributing it to that plugin or another.
My 2 cents
Cheers