How restrict the user from opening a new order?

 
Hi,
I need a code that does not allow the user to open a new order under certain conditions.
Should this be in the form of an Expert or Script?