Long post; edited for brevity but I had to include a lot of rationale too. Context: I'm an enthusiast programmer for some 8 years, gearing up for a tech college program (building maintenance doesn't cut it anymore

Question #1: Is anyone aware of a language parser that may not be perfect but weighs in under 5,000 - 10,000 lines? My brain's already packed, and ANTLR seems overkill.
Question #2: If nobody is aware of #1, would the approach I've outlined below seem to be the right one?
Question #3: Would anybody actually like to use this software? I hope the editor & my engine's binding methods would make for a great contribution, as I'd love to give back in some way. Trying to decide where to spend my time though!
I'm writing a cross-platform 2D game/GUI engine. In the process of writing scripts the most WYSIWYG editor I've found is Programmer's Notepad. My needs quickly outgrew what it provides. I realize 2D engines are very passé, so my goal has been to create a set of tools that allow complete novices to get a serious jump start on programming.
As such, I need to write an IDE and have completed a little mock-up in C# (see imperfect screenshot). Sheer simplicity is the main goal, with autocompletion being the lofty target. I'm sticking with C# because it makes my life easier and I can port to Mono later without massive headaches.
All the classes in the C++ engine implement a static method allowing me to bind everything quick & clean inside main(). After everything is bound and the scripts compile, a definition file is written containing symbols the binder & AngelScript are aware of. A snippet of this file:
Operator(>>>)
StatementEnd(
Operator(,)
BlockStart({)
Var(GameInfo,Game)
Var(ConfigFile,Configuration)
Var(AnimationManager,Animations)
class(WindowManager)
Method(void,Run,)
Method(void,Start,)
Method(void,Render,)
Method(void,End,)
endclass()
class(LayerManager)
Method(Layer@,Create,)
Method(void,Destroy,Layer@ which)
endclass()
Using some string search & regex kludges I can get syntax highlighting working fairly easily using this data alone. The big problem comes in when considering speed of (1) scanning script files to create symbols & (2) autocompletion. I'm currently splitting each script file into tokens (designated with start/end positions and retrieved with properties) and assigning them a loose type to start (function, variable, primitive, class, etc). This lets me use a TokenBrowser to jump around a pre-split file to resolve type names and determine which block I'm in, etc. Down the road, it should allow for relatively fast while-you-type insertions into the token list to provide an experience similar to what Visual Studio is capable of.
Leading to Question #4: In essence, I'm trying to decide whether I'm going about this all wrong. If the general opinion is that this is a redundant idea that will land 2 downloads, nothing to give back to AS, and strange glances from future employers, I'll be off to the next thing. If there's even a glimmer of hope for such a tool's use I'll keep plugging away though! Any advice is welcome.