Almost. There is one error in the original suggestion (I did not
see it previously). Instead of checking against `c(version)'
check against `c(stata_version)'.
So it should look something like
program myprog
version 8.2
local oktype = cond(`c(stata_version)' < 9, ///
"integer `c(level)'", "cilevel")
syntax ... , ... Level(`oktype')
Good point! c(stata_version) is the version of Stata you really really are
using, whereas c(version) is the version that is being mimicked by the
version command. So, because of the version 8.2 command, in the original
code the condition always would have evaluated as true.