Magento2: Programmatically change order status before order placement?

I want to change order status programmatically before order placement. My Code: events.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Event/etc/events.xsd”> <event name=”sales_order_place_before”> <observer name=”amy_ordersuccesscart_observer_salespayapal” instance=”Amy\Ordersuccesscart\Observer\Salespayapal” /> </event> </config> Observer file: <?php namespace Amy\Ordersuccesscart\Observer; use Magento\Checkout\Model\Session; use Magento\Framework\App\ResourceConnection; use Magento\Sales\Api\OrderItemRepositoryInterface; use Magento\Sales\Model\Order; class Salespayapal implements \Magento\Framework\Event\ObserverInterface { protected $quoteRepository; protected $connections; protected $_productRepository; protected $_customerRepositoryInterface; protected $_helperdata; protected…