Out integration with CKEditor 4 provides access to the editor’s instance, but doesn’t add any extra methods except the possibility to quickly get/set a value.
The solution will probably require accessing editor’s document and using its regular API, similar to this: Code Snippet