The human respiratory syncytial virus (hRSV) is a major cause of serious lower respiratory infections and poses a considerable risk to public health globally. Only a few treatments are currently used to treat RSV infections, and there is no RSV vaccination. Therefore, the need for clinically applicable, affordable, and safe RSV prevention and treatment solutions is urgent. In this study, an ion-activated in situ gelling formulation containing the broad-spectrum antiviral 18β-glycyrrhetinic acid (GA) was developed for its antiviral effect on RSV. In this context, pH, mechanical characteristics, ex vivo mucoadhesive strength, in vitro drug release pattern, sprayability, drug content, and stability were all examined. Rheological characteristics were also tested using in vitro gelation capacity and rheological synergism tests. Finally, the cytotoxic and antiviral activities of the optimized in situ gelling formulation on RSV cultured in the human laryngeal epidermoid carcinoma (HEp-2) cell line were evaluated. In conclusion, the optimized formulation prepared with a combination of 0.5% w/w gellan gum and 0.5% w/w sodium carboxymethylcellulose demonstrated good gelation capacity and sprayability (weight deviation between the first day of the experiment (T0) and the last day of the experiment (T14) was 0.34%), desired rheological synergism (mucoadhesive force (Fb): 9.53 Pa), mechanical characteristics (adhesiveness: 0.300 ± 0.05 mJ), ex vivo bioadhesion force (19.67 ± 1.90 g), drug content uniformity (RSD%: 0.494), and sustained drug release over a period of 6 h (24.56% ± 0.49). The optimized formulation demonstrated strong anti-hRSV activity (simultaneous half maximal effective concentration (EC50) = 0.05 µg/mL; selectivity index (SI) = 306; pre-infection EC50 = 0.154 µg/mL; SI = 100), which was significantly higher than that of ribavirin (EC50 = 4.189 µg/mL; SI = 28) used as a positive control against hRSV, according to the results of the antiviral activity test. In conclusion, this study showed that nasal in situ gelling spray can prevent viral infection and replication by directly inhibiting viral entry or modulating viral replication.