I use the following:
if(getd('dbGetDatabaseType) && dbGetDatabaseType() == "OpenAccess" then
This works with very old Cadence versions that don't even have dbGetDatabaseType yet defined.
We have a lot of skill code and getting all of our designs on 6.1.x will take quite some time (we don't have any parts there yet). I presented a paper at an Si2 conference about the effort we have been doing to try not to "branch" our code, but rather to make it compatible with both 5.1 and 6.1. The power point is available here: http://www.si2.org/events_dir/2006/oaconfspring2006/micron.pdf
As you can see, I presented that in 2006 and we still haven't moved any parts to OA. We have wrapper functions in our Skill that allow us to easily test each new 6.1 release while only maintaining one stream of code.