System.tag.query source code

Is there any chance the source code for this particular method/function can be provided? I think some time ago, the structure slightly of the json slightly changed to accommodate and/or conditions together. I'd like to be able to reproduce this and cater it to my needs instead of creating a wrapper to this method and it potentially not work in the future if any changes were to occur.

No, nor would it be particularly meaningful; there's no single place it's implemented, as the tag system is far reaching and complicated.

Scripting functions are documented public API and we hold a pretty strict contract on them. While the JSON payload did change, we went to great pains, as far as I can tell, to continue to support the old output format in the new version. If we ever had to change the structure in the future, I would expect us to do so again.