Not only is it possible/feasible, the SRD provides a number of examples in the Trap section.
Your desired spell grenade is simply the Burning Hands trap applied to rock -- although personally, I recommend using a crossbow bolt with a trailing rope for increased range and easy retrieval. Its priced as an auto-reset repeating effect, so the cost for a single-use version would be 50gp, 4xp if that's your preference.
"Burning Hands Trap: CR 2; magic device; proximity trigger (alarm); automatic reset; spell effect (burning hands, 1st-level wizard, 1d4 fire, DC 11 Reflex save half damage); Search DC 26; Disable Device DC 26. Cost: 500 gp, 40 XP."
Traps :: d20srd.org
While the SRD implies a creative 1st or 2nd level sorcerer/wizard could spell-trap an area, the true potential for traps requires the Craft Wondrous Item feat (3rd level requirement) for the development of trapped physical objects with the reset option.
Secondly, although the examples focus on using offensive spells to punish anyone violating the protected area, there's no reason the detector couldnt trigger a nonlethal or even helpful spell given gm approval.
ie: *. crossbowbot(wall of fire) behind the enemy to prevent retreat
*. crossbowbolt(light) to back-light the enemy ranks.
*. item(buff) w/touch or proximity trigger
*. item(curative) w/touch or proximity trigger
*. item(create food/water) triggered by touch to eliminate carrying rations
Im sure many more creative ideas will begin flowing in??