You should use a sound or a log entry and isolate the not working code line:
#define PRAGMA_PATH "%EXE_DIR%\\templates\\sounds"
SOUND *sndBeep = "beep.wav";
Play it to the beginning of your function
function item_was_dropped ()
{
snd_play ( sndBeep, 100, 0 ); // Is 'item_was_dropped' properly called?
...
In the case it sounds, move it to the next flux control:
function item_was_dropped ()
{
if ( !mouse_panel ) // Is the mouse pointer out of a panel?
{
snd_play ( sndBeep, 100, 0 ); // is it?
Anyway it is a mistery for us the way you call your 'item_was_dropped' function and it can come from there.
Salud!