How to add this code to Blynk

Yes and no… The IDE Serial Monitor requires the USB link. But depending on the MCU used, there are a few ways of redirecting Serial output and even Blynk Print/Debug info, back to a Widget display (usually Terminal) or an attached OLED, LCD, even VGA display. They are not straight forward though.