apache mod_rewrite: How to add different rewrite rules for same directory depending on file existence in other directory?

I'm currently having a bit of trouble to configure the rewrite rule(s) in a .htaccess file for an Apache 2.2 server with mod_rewrite. Here's the general idea of what I want to do:

Let's say the server domain is example.com/, and all requests to example.com/abc/ and paths below that directory shall be rewritten. There are two scenarios:

Requests directly to example.com/abc/ or example.com/abc/index.php shall become requests to example.com/index.php with an additional parameter to indicate the original directory of the request. To give a few examples:

example.com/abc/

==>

example.com/abc/index.php?directory=abc

example.com/abc/?foo=1&bar=2

==>

example.com/abc/index.php?directory=abc&foo=1&bar=2

example.com/abc/?a=b&c=d

==>

example.com/abc/index.php?directory=abc&a=b&c=d

... and so on

Requests to files within example.com/abc/ shall become requests to files in example.com/, if these files exist there. parameter to indicate the current directory. To give a few examples:

The later rule seems to work, requests to example.com/abc/index.php get rewritten as intended. However, that does not work for files in the abc/ directory.
Any hints on what I am doing wrong here and how to solve that problem are appreciated. What changes have to be applied to .htaccess to get things working as described?