ok, maybe i'm wrong here, but I believe there is no need to use sp_msForEachDB:
that dmv creates ALL the missing indexes in for All databases that meet the missing index criteria.
for example, even though i ran it in a different database(master), it gave me a suggestion for the database "NewGeo"
CREATE INDEX
[missing_index_163_162_CITYDATA]
ON [NewGeo].[dbo].[CITYDATA] ([STATE])
INCLUDE ([COUNTYNAME])
Lowell