Hope this one helps.
Use GDAL rasterize to conver polyline to raster, then it is possible to run r.neighbors
with a 3 (by 3) sized neighbourhood. see also in this post.
This is my result on some lines drew on WGS84. This is only a snapshot but the method works for all featurs and/or raster cells. Original polyline colored yellow, in black are the polyline to raster result. Then layered underneeth in red is the last raster with a 3 pixel "buffer".
It quite similar to the workaround you have suggested, but enable you to drop scripting and use GRASS tool instead. I find it to be most intuitive way to handle such a problem.
I did further research, and the following three "vendorOption" parameters were recommended where labels are left off when you really want them labeled in the tiles. I'll explain each briefly and why it did or did not help in my case.
<VendorOption name="spaceAround">-1</VendorOption>
<VendorOption name="conflictResolution">false</VendorOption>
<VendorOption name="partials">true</VendorOption>
The first "spaceAround" option, if less than zero, will draw labels even if they overlap labels that are already drawn, often making one or more illegible. This was not my issue. My labels were well spaced apart, just some were disappearing at certain zoom levels.
The next, "conflictResolution", I believe also says to draw the label even if it may conflict with another. I have not added this one, I don't think it is relevant to my issue.
The final "partials" set to true fixed my problem. If the tile processor thought the label would overlap the edge of the tile, it was removing it. That is the default behavior. That was causing them to disappear when zoomed in, depending on where it landed on the tile it existed on at that zoom level. So they were "randomly" disappearing. Once I set this to true, the labels all appear at every zoom level. So my problem is now solved.
I did set some "gutter" values to be up to 200 in some cases, in my attempts to resolve the issue. This may be slowing down my tile generation. I'll now probably go drop those down again. I think I want some gutter, so that the labels can overlap tile boundaries and still draw nicely.
So if you look at the SLD above, at the very end of it I've simply added this one VendorOption after the end of the Fill node:
</Fill>
<VendorOption name="partials">true</VendorOption>
</TextSymbolizer>
This is where you want to put it, at the very end of your TextSymbolizer.
Best Answer
The css values are in pixels so you probably won't see much change with fractional values. Try using 0 as I think GeoServer handles that as a special case.
Further information on SLD can be found at http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/lines.html