There's no portable way to test if a function exists in Awk. If you're calling the Awk script from a shell, you can make Awk calls to test for the existence of functions first.
if awk 'BEGIN {asort(a)}' <>/dev/null 2>/dev/null; then
define_asort=
else
define_asort='
function asort() { … }
'
fi
awk "$define_asort"'
… rest of script …
'
If you're only trying to distinguish GNU Awk from others, you can test on some other GNU Awk feature. Calling an undefined functions causes a fatal error in Awk, but using an undefined variable is always fine and returns an empty value. You can in particular use PROCINFO[version], which since Gawk 3.1.4 contains the Gawk version number.
function my_sort(a) { … }
function sort_wrapper(a) { if (PROCINFO["version"]) asort(a); else my_sort(a); }