My solution is: Do not use Wcf Data Services which is still incomplete, if you need security and reliability, use Wcf Services, so you can have entity framework in its own extent. Wcf data services is not mature enough.
For the scripts, iam using string concatenation with stringbuilder.