Maybe something like:
```php
/** @var $payment PaymentInterface */
if ($payments->exists(function($key, $payment) {
    return in_array($payment->getState(), array(
        PaymentInterface::STATE_COMPLETED,
        PaymentInterface::STATE_PROCESSING,
        PaymentInterface::STATE_PENDING,
    ));
})) {
    $order->setPaymentState(PaymentInterface::STATE_PROCESSING);

    return;
}