It should be very simple to do that, but precision is the problem... It depends on the frequency response and the sensitivity of the intenal microphone. You think to use an external microphone, but if you want to buy a good measure microphone you can certainly buy a good spl meter.
Also consider that only a few DAPs have a microphone input. I have a H120, but my Sansa Fuze has only internal mic.
A cheap microphone like the Behringer ECM8000 is not good: years ago I bought two of them as cheap stereo pair (I have Shure and Sennheiser Microphones, but it was an experiment). Frequency response was very different at low and high frequencies; also sensitivity was different...
If you need a spl meter you can buy for only 60$ something like that:
http://www.tnt-audio.com/clinica/spl-meter_e.htmlA computer based spl meter may have a calibration file, but you should know the response of that unique microphone or calibrating the instrument.
If we want a simple gadget and it is simple to program it could be interesting. It could have A and C weighting, optional calibration file (for he who can use it) and a frequency meter for single test tones.
Also a spectrum analyzer should be simple to do, using mp3 algorithms. A calibration file could be done by some people of us (like me) who has or can use for a few minutes a studio monitor/home stereo set/anechoic room :-) and play a pink noise mp3 file, then sharing the calibration file in the forum, telling the set he used.