This script was designed with the intent to have players clear a dungeon before they can down the boss. Since players try to pass things to get the boss done faster and all.
It could also be used for a boss to trap the players until defeated. This is not recommended however.
The script is a base that extends the base creature script. To use it you add to your script folder or sub folder. Then you can create a new script for your blocking creature like any other creature however in the constructor of your creature you will have to add the visible itemid, x location, y location, width, height, and item hue for the blockers.
The script will spawn the item in the area specified as well as blockers and losblockers to prevent passing. Once deleted or killed the script will remove all of the blocking items and let your players through.
After the above the blocking creature is like any other base creature and subject to your code.