Here is a workarround (with SWS extension check)
ReaScripts-Templates/X-Raym_Check if SWS is installed and download if not.lua at master · ReaTeam/ReaScripts-Templates
The trick is to loop in reaper function table and store existing key (aka function names) in a table, and check if an extension function (no matter which one) exist in this table or not.
It doesn't return REAPER error if it doesn't exist.
EDIT: code snippet updated with new method, base don NammedCommand