Why don't you just use LibCustomMenu as it integrates and was build EXACTLY for that purpose?
Other addons using the same lib are compatible on the fly and you do not destroy other addons by making your own hacks and workarounds.
Do what you like but those libs exist for a reason and often also provide the easiest way achieving the goal.
Add it as an optional dependency and tell the guys that your addon's feature with the context menu only works if the lib is installed.
Do an
Lua Code:
if not LibCustomMenu then return end
check at the start of your function that adds the context menu and all is done.
Users can use your adodn w/o dependecy then and only need it for the context menu features.