This is certainly a chicken-egg problem. No developer will ever put Categories in his .desktop-files if they go unused on the N900.
for i in *.desktop; do PKG=`dpkg -S "${i}"` SECTION=`apt-cache show "${PKG}" | grep ^Section: | cut -d' ' -f 2 }
So why not write to the .desktop file in case it doesn't already include a category (or in case the category needs to be changed) and then always read from the .desktop file when you have to determine where to put an application?