What you are describing can be best prevented with the use of BPDU Guard. When used on ports that have portfast enabled it will immediately shut down the port if BPDU frames are seen. This would happen if a user loops the port. You should not use it, or portfast, on ports that connect to network devices.
This command was introduced with version 12.0(5)WC5 for the 3548.
The interface command would be:
spanning-tree portfast bpduguard
On the 4006
set spantree bpdu-guard X/X
http://www.cisco.com/en/US/tech/tk389/tk621/technologies_tech_note09186a008009482f.shtml