Alternate Item Auto SO Line Entry

https://www.sagecity.com/us/sage100/f/unique-business-challenges/190272/un-hemmed-pants-inventory/476813#476813

I am revisiting this topic, would scripting be an option to automatically select the first alternate item with sufficient available inventory when an item that has insufficient inventory is entered on a line?  I am trying not to give the user the option to choose if they want to use an alternate item, I what to make it automatic.  The item quantity defaults to BackOrdered if there is not enough stock available right now, not sure if this could be used as a flag?

This also jumps to another post I made about the "entry exceeds...." pop up screen.  We were able to bypass the pop up through a security event checkbox in SO.  That is why I am trying to automate the selection of the alternate item.

https://www.sagecity.com/us/sage100/f/business-object-interface/194039/automate-script-available-quantity-pop-up