Make device appear online when using Rest API

Okay, the error message when changing values, and the device offline indication won’t go away unless you solve your “invalid auth token” issue.
This is because the Blynk server is expecting the device to have an open, constantly maintained, channel of communication with the device, so that the device instantly knows when a widget value has changed.

The alternative is to move away from the Pythion script, or somehow incorporate what this script is doing, and use Node-Red instead (or as well).

Node-Red, with the Blynk IoT plug-in (contribution or contrib in Node-Red speak) will establish and maintain that ssl/tls connection with Blynk, and incoming values from widgets attached to virtual pins will be available within Node-Red.
You could then potentially use the node-red-node-pi-gpio plug-in for Node-Red to change GPIO values on the Pi, or maybe even communicate with your Python script.

To be honest, Node-Red could probably do everything that your Python script currently does, and communicate with Blynk and other peripheral systems at the same time.

Pete.