For an example of SSMS alternative, see https://github.com/Microsoft/azuredatastudio.
In order to determine if a script return data like a SELECT query, I think that you can try something like this:
declare @text as nvarchar(max) = 'declare @x int = 123; select @x'
select * from sys.dm_exec_describe_first_result_set( @text, null, 0)
If this special function returns rows, then the checked script returns data.
In case of DELETE, for example, nothing is returned:
set @text = 'delete from Users'
select * from sys.dm_exec_describe_first_result_set( @text, null, 0)
However, an SQL script could include several kinds of statements, calls of stored procedures, etc.