The functionality of Olex2 can be extended on two levels: though macros and through python scripts.
Extending Olex2 through Macros
Extending Olex2 through Plug-Ins
Writing Python code for Olex2