You need to write a Reporter Plugin. Then put your drawing code in one of the available drawing callbacks. You can’t “just draw”. You can tell the system that the view needs to be redrawn and then the system asked you (in a “drawRect_” callback) to draw whatever you like. The edit view will ask all active Reporter plugins to draw.
For learning, I would recommend the Skedge plugin by Mark Frömberg (freely available in the plugin manager). There, you can test your code live without having to write a reporter plugin and loading it every time you want to test it again.
Yes, I was about to recommend Skedge too, which will actually enable to “just draw”. See it as a drafting tool to play around until you get your result (at least roughly) and then take the code from Skedge and stick it into one of the drawing methods (e.g. drawForeground, drawBackground) of a reporter plugin.
Your code looks like the right direction, in Skedge it might already work. You don’t need the Glyphs.redraw() (not in Skedge and not in a Reporter plugin).
If you want to show the outlines, use stroke() instead of fill(). For that you can also set the lineWidth (e.g. setLineWidth_(2/scale))
You could change your specificPath to specificPaths, which won’t change a thing code wise, but it is good practice to make your variables show what they are (in this case a list of paths, not one path). Just a tip
Layer with a capital L is already the current layer in most scenarios. It might be that it is not the shortcut for it in Skedge (or maybe even a plugin(?)), but I recommend to use layer instead to avoid confusion with built in objects. (same with Font for example)
I just wanna check that whether the foreground or backdroubd drawing function is only avalible in Reporter (*.glyphsReporter) type plugin or it can be access in other general plugins (*.glyphsPlugin).
It seems like I can only use Reporter plugin. I’ll give it a try.