SQL Management studio 'script' feature is great for people trying to learn T-SQL and wanting to know what's happening underneath a GUI. As far my understanding goes this feature should not execute any command automatically (just create T-SQL code for us, that we can review or use later on).
There is one exception to that. IF after we open database context menu and choose Take offline task, and we decide to click 'Script' - the database will just go offline without any warnings. Even if we cancel this menu database will stay offline.
I think it's a bug because script feature should never work this way.