At the basic, you can license different parts of your work differently. This happens often, if you include libraries with different compatible open source licenses in your project. The library is licensed differently to your project.
But doing as you describe has a lot of downsides.
1. It's complicated
You somehow have to indicate, which part is licensed how. This can be complicated enough if you license some files differently, if you do it for lines it will look horrible.
2. It might be incompatible to some open source licenses
Such a behaviour might be incompatible with certain open source licenses. Especially copyleft-licenses would be problematic. As long as the whole work is completely copyrighted by you it might work, but if you include for instance GPL-code, then you violate the license.
3. It might confuse potential users
Open Source is generally good for users. Such complicated license mess could confuse potential users, so they are unsure if these lines with other licenses somehow affect them. You may loose users.
4. It might discourage potential contributors
The inconclusive license situation might be a no-go for many programmers and so they decide not to contribute to your project.
5. It misuses the trust of others
Open Source is usually met with a lot of trust that is hard earned. Creating such difficult license situation as you describe violates this trust. This might have negative long term effects on your reputation and the reputation of your project ... and it is basically wrong. (Thanks to Andrew Russell for the suggestion, see comments.)
TL;DR: It is possible but unwise.