Serial number sounds like something that would require low level access to the card, which I'm afraid is currently beyond CHDK's capabilities.
CHDK certainly could be modified rename files according to user setup, but renaming files causes severe usability problems: Renamed files probably disappear from play mode (or show as broken images until rebooted) and they may not be available for USB photo transfer via PTP at all, only card readers. For RAW/DNG PLAY mode doesn't matter, and USB doesn't matter if you don't use USB anyway (possibly the majority of users do, though).
I'm not sure why you'd want to tie file naming to a specific card, but if it's enough to have this code in EXIF (you can always mass rename with exiftool according to any tag), I guess you could find a way to have CHDK change the camera owner string in ROM whenever a card with a code different from the previous card's code is insterted. The code would be stored in a file on each card somewhere. If you only shoot DNG, this is of course much easier since CHDK writes the DNG EXIF.