Is it possible to write a Safari extension that changes the web browsers preference settings?
If so where would I find documentation on this? I would like to add a search engine to the list of default ones so if there is already an extension that does this that you know off that would also be great.
Unfortunately the answer to your question would be a No
, at least for now.
As to where you can find out more about this information, you may refer the MDN documentation on browser settings.