I could see that for restoring a snapshot in a production rollback scenario.
To be fair and complete you have to be out of the DB to restore WITH REPLACE too but it's not likely that anything will get in between the USE master and the RESTORE DATABASE in a scenario (likely non-prod or DR) where you're restoring WITH REPLACE:
ALTER DATABASE YourDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE; -- forcefully kills all user sessions that are not yours and rolls back open transactions
USE master; -- must do, not explicitly shown before
RESTORE DATABASE ...
__________________________________________________________________________________________________There are no special teachers of virtue, because virtue is taught by the whole community. --Plato