From the SRD:
Creatures encountering an illusion usually do not receive saving throws to recognize it as illusory until they study it carefully or interact with it in some fashion.
A successful saving throw against an illusion reveals it to be false, but a figment or phantasm remains as a translucent outline.
A failed saving throw indicates that a character fails to notice something is amiss. A character faced with proof that an illusion isn't real needs no saving throw. If any viewer successfully disbelieves an illusion and communicates this fact to others, each such viewer gains a saving throw with a +4 bonus.
I would say that trying to smash the illusory box counts as sufficient proof to have the enemy immediately disbelieve.
You could have the box try to avoid the attack (though this makes more sense with illusory creatures). In this case the box (or creature) has AC 10 + (size mod).
A few tips when using illusion spells (these are of course my own opinion):
- Try to create things that will block the enemy but that they wont want to interact with. A box of stone would naturally cause the enemy to break out of it (thought that will waste the enemies attack). If suddenly surrounded by a dome of acid or a dome of ominously swirling energy, the same enemy might react differently.
- Illusory creatures are often a good choice as they can move about and reasonably dodge.
- Knowledge checks are great, for example goblins usually hate gnomes and hate and fear horses. An illusion of a gnome on horseback could be a good choice to draw fire.
- Try to create things that fit within the limitations of your spell. Silent image is great but your foes might grow suspicious at a bear that makes no sound but might not question a silent wraith.