Will iMovie erase my work if I quit it?
Sadly, you've passed the point where you get to save your work.

Luckily, iMovie periodically saves the application database / library so you are unlikely to lose everything if you decide to shut down the Mac or force quit the application. Once you regain control of the application (you already know you can't do anything with it stuck in a state where it's no longer responding to messages, input - a.k.a spinning wheel of death) you can see if the changes you made are missing.

If they are, a call to apple support might be needed to restore the backup copies of the library it has made internally since Apple doesn't document how to restore a previous iMovie library publicly.

Going forward, you can set a timer and periodically save/quit iMovie and then back up the files. Time Machine allows you to make local snapshots if you don't have your backup volume connected.

sudo tmutil enablelocal


Then to make a point in time snapshot of all the files, quit iMovie and then run in terminal:

tmutil snap


That saves a neat point in time version of all your files that you can then recover later using the Time Machine interface.