Note that your screenshot indicates that by default, the Script Editor will be saving things to the iCloud Drive Script Editor folder instead of to your local drive. That may be fine as long as you remember that, but if you want to save to your local drive, then 1) change the location in your screenshot, or 2) disable the iCloud Script Editor location by System Preferences > Apple ID > iCloud Drive > Options… ☐ Script Editor.
AppleScript is a programming language primarily designed to work with individual applications that include an application-specific scripting dictionary and reserved commands that work with these applications. You can see a list of applications with these scripting dictionaries from the Script Editor's File menu > Open Dictionary…
AppleScript has nothing in common with BASIC, or even higher-level programming languages that use more modern data structures. It was available as far back as Mac Classic and has not changed considerably since.
There is an online AppleScript Language Guide that is indispensable for learning AppleScript syntax from within the Script Editor. Apple provides an online Script Editor User Guide for Ventura that has changed little since its version for Big Sur. You may want to visit the rebooted :macScripter.net site for examples of AppleScript code that solve problems. And there are other AppleScript references here. Note that most of the good AppleScript books are quite old now, but for the most part, still relevant, with some terminology changes.
Apple's future direction and commitment to AppleScript may eventually change and those who were its biggest champions have left Apple.