I don't know whether this can be done with LuaTeX (maybe yes). But under (pdf)TeX this can't be done in full generality.
First of all let's recall how comments work. TeX reads a line of input and, before starting to transform the characters into tokens, it does some jobs.
It throws away the operating system provided end-of-record byte (if any; some old operating systems don't have it) and everything that remains in the line after it.
It throws away all spaces that might remain at the end of the record (and tabs, under implementations based on Web2C, which are the most commonly used). This independently of category code, as they have not yet been attached to characters.
It adds at the end of the record the current \endlinechar (none if the parameter is negative or beyond the engine dependent maximum value, which is 255 for TeX and pdftex, 0x1FFFFF for XeTeX and LuaTeX).
It does what is prescribed by its current state with respect to category code 5 and 10 characters; under normal circumstanes it throws away initial spaces and it possibly inserts a \par token (see the TeXbook or TeX by Topic for details).
Now it starts tokenizing and it's here where comments are discarded: a category code 14 character causes TeX to ignore it and everything up to the end of the line, the added \endlinechar included.
One might think to define % as an active character, which looks for a following % and, in this case, inserts a category code 14 character in the input. Maybe doing this only in the document environment, so that comments work as usual in the preamble. This fails in two ways.
If TeX is not expanding macros, the %% pair would be recognized too late. For example
\parbox{abc %%
def}
wouldn't work as expected, because the active % wouldn't be expanded when the argument to \parbox is absorbed.
Even if one ensures that no %% pair is in the argument to a macro, it's impossible to put a character code 14 character in the replacement text of a macro: no category code 0, 5, 9, 14 and 15 character can reach TeX's "stomach", where macro replacement texts are examined and stored in memory (TeXbook, exercise 7.3).
One might think to overcome this limitation by defining % to look for a following % and, in this case, to issue a macro \gobbletoend defined by something like
\def\gobbletoend%1^^M{}
but, alas, this can't be done for two reasons: ^^M (category code 5) can't reach TeX's stomach and, moreover, TeX wouldn't even see the pair of braces, because, when absorbing that line it would see ^^M which is the ASCII end-of-line and it would throw it away with the rest of the line. So the macro can't have its argument delimited by a category code 5 ^^M, which is something like \obeylines does, but you don't want that every end-of-line that's not preceded by %% has a final \par, so the definition ought to be much more complicated.
A possible way is to do like in the following example:
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\begingroup\lccode`~=`\%
\lowercase{\endgroup\def~{\new@ifnextchar~\tohecz@comment\%}}
\def\tohecz@comment{\catcode`\^^M=3 \tohecz@commentignore}
\begingroup\lccode`$=`\^^M
\lowercase{\endgroup\def\tohecz@commentignore#1$}{\catcode`\^^M=5 }
\makeatother
\begin{document}
\catcode`\%=\active
abc %% def
abc % def
abc %
def
\end{document}
The Kant paragraph is just to show that paragraphs are correctly terminated; \new@ifnextchar from amsmath is used to avoid gobbling spaces. Recall, however, that %% can't appear in the argument to a command.

~) between numbers and the percent sign. (I consider it a unit-like symbol and would use\,/siunitx, anyway.) Bottom line: I'm voting for regex here. – Qrrbrbirlbel Oct 20 '12 at 16:16%%as a comment by setting%active wouldn't work: in many situations%is seen when TeX is not expanding macros, even in thedocumentenvironment: for example when you end a line in a\parboxwith what should be a comment. – egreg Oct 20 '12 at 19:24