Just ran into a situation where I need this. An ACS function that returns the level name, and the level lump name, as a string.
Currently hacking my way through this by assigning LevelNums to the levels in MAPINFO and just checking against that, but that won't work in the long run!